mirror of
https://github.com/coder/code-server.git
synced 2025-07-31 14:04:06 +08:00
Add file for global constants
This commit is contained in:
13
src/node/constants.ts
Normal file
13
src/node/constants.ts
Normal file
@ -0,0 +1,13 @@
|
||||
import { logger } from "@coder/logger"
|
||||
import * as path from "path"
|
||||
|
||||
let pkg: { version?: string; commit?: string } = {}
|
||||
try {
|
||||
pkg = require("../../package.json")
|
||||
} catch (error) {
|
||||
logger.warn(error.message)
|
||||
}
|
||||
|
||||
export const version = pkg.version || "development"
|
||||
export const commit = pkg.commit || "development"
|
||||
export const rootPath = path.resolve(__dirname, "../..")
|
Reference in New Issue
Block a user