cc-team-viewer 1.4.30 → 1.4.31
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/lib/updater.js +9 -3
- package/package.json +1 -1
package/lib/updater.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { readFileSync, writeFileSync, mkdirSync, existsSync } from 'node:fs';
|
|
2
2
|
import { execSync } from 'node:child_process';
|
|
3
|
-
import { join } from 'node:path';
|
|
3
|
+
import { join, resolve } from 'node:path';
|
|
4
4
|
import { homedir } from 'node:os';
|
|
5
5
|
import { fileURLToPath } from 'node:url';
|
|
6
6
|
import { dirname } from 'node:path';
|
|
@@ -14,8 +14,14 @@ const CACHE_FILE = join(CACHE_DIR, 'update-check.json');
|
|
|
14
14
|
const CC_SETTINGS_FILE = join(homedir(), '.claude', 'settings.json');
|
|
15
15
|
|
|
16
16
|
function getCurrentVersion() {
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
try {
|
|
18
|
+
const pkgPath = resolve(__dirname, '..', 'package.json');
|
|
19
|
+
const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));
|
|
20
|
+
return pkg.version;
|
|
21
|
+
} catch (err) {
|
|
22
|
+
console.error('[CC Team Viewer] Failed to read package.json:', err.message);
|
|
23
|
+
return '0.0.0';
|
|
24
|
+
}
|
|
19
25
|
}
|
|
20
26
|
|
|
21
27
|
function parseVersion(ver) {
|