Skip to content

Commit b41a032

Browse files
committed
code review comments
1 parent 7d06103 commit b41a032

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/node/constants.ts

+10-5
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,31 @@ export function getPackageJson(relativePath: string): JSONSchemaForNPMPackageJso
1717
}
1818

1919
const pkg = getPackageJson("../../package.json")
20+
const codePkg = getPackageJson("../../vendor/modules/code-oss-dev/package.json")
2021

2122
export const pkgName = pkg.name || "code-server"
2223
export const version = pkg.version || "development"
2324
export const commit = pkg.commit || "development"
2425
export const rootPath = path.resolve(__dirname, "../..")
2526
export const vsRootPath = path.join(rootPath, "vendor/modules/code-oss-dev")
26-
export const codeVersion = require(path.join(vsRootPath, "package.json")).version || "development"
27+
export const codeVersion = codePkg.version || "development"
2728
export const tmpdir = path.join(os.tmpdir(), "code-server")
2829
export const isDevMode = commit === "development"
2930
export const httpProxyUri =
3031
process.env.HTTPS_PROXY || process.env.https_proxy || process.env.HTTP_PROXY || process.env.http_proxy
3132

32-
// getVersionString returns a human-readable version string suitable
33-
// for outputting to the console.
33+
/**
34+
* getVersionString returns a human-readable version string suitable
35+
* for outputting to the console.
36+
*/
3437
export function getVersionString(): string {
3538
return [version, commit].join(" ")
3639
}
3740

38-
// getVersionJsonString returns a machine-readable version string
39-
// suitable for outputting to the console.
41+
/**
42+
* getVersionJsonString returns a machine-readable version string
43+
* suitable for outputting to the console.
44+
*/
4045
export function getVersionJsonString(): string {
4146
return JSON.stringify({
4247
codeServer: version,

0 commit comments

Comments
 (0)