@hangox/mg-cli 1.0.4 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/VERSION +1 -0
- package/dist/cli.js +17 -4
- package/dist/cli.js.map +1 -1
- package/dist/daemon-runner.js +17 -4
- package/dist/daemon-runner.js.map +1 -1
- package/dist/index.js +17 -4
- package/dist/index.js.map +1 -1
- package/dist/server.js +17 -4
- package/dist/server.js.map +1 -1
- package/package.json +3 -2
package/VERSION
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1.0.5
|
package/dist/cli.js
CHANGED
|
@@ -766,13 +766,26 @@ function getVersion() {
|
|
|
766
766
|
try {
|
|
767
767
|
const currentFile = fileURLToPath(import.meta.url);
|
|
768
768
|
const currentDir = dirname3(currentFile);
|
|
769
|
-
const
|
|
769
|
+
const versionFilePaths = [
|
|
770
|
+
join2(currentDir, "..", "VERSION"),
|
|
771
|
+
// dist/xxx.js -> ../VERSION
|
|
772
|
+
join2(currentDir, "..", "..", "VERSION")
|
|
773
|
+
// src/shared/version.ts -> ../../VERSION
|
|
774
|
+
];
|
|
775
|
+
for (const versionFilePath of versionFilePaths) {
|
|
776
|
+
if (existsSync3(versionFilePath)) {
|
|
777
|
+
const version = readFileSync2(versionFilePath, "utf-8").trim();
|
|
778
|
+
if (version) {
|
|
779
|
+
cachedVersion = version;
|
|
780
|
+
return cachedVersion;
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
}
|
|
784
|
+
const packageJsonPaths = [
|
|
770
785
|
join2(currentDir, "..", "package.json"),
|
|
771
|
-
// dist/xxx.js -> ../package.json
|
|
772
786
|
join2(currentDir, "..", "..", "package.json")
|
|
773
|
-
// src/shared/version.ts -> ../../package.json
|
|
774
787
|
];
|
|
775
|
-
for (const packageJsonPath of
|
|
788
|
+
for (const packageJsonPath of packageJsonPaths) {
|
|
776
789
|
if (existsSync3(packageJsonPath)) {
|
|
777
790
|
const packageJson = JSON.parse(readFileSync2(packageJsonPath, "utf-8"));
|
|
778
791
|
if (packageJson.name === "@hangox/mg-cli") {
|