squeezr-ai 1.16.7 → 1.16.8
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/bin/squeezr.js +17 -6
- package/package.json +1 -1
package/bin/squeezr.js
CHANGED
|
@@ -1044,14 +1044,25 @@ switch (command) {
|
|
|
1044
1044
|
}
|
|
1045
1045
|
}
|
|
1046
1046
|
|
|
1047
|
-
//
|
|
1048
|
-
try {
|
|
1047
|
+
// Write cache with the new version so neither parent nor child shows stale banner
|
|
1048
|
+
try {
|
|
1049
|
+
const newPkg = JSON.parse(fs.readFileSync(path.join(ROOT, 'package.json'), 'utf-8'))
|
|
1050
|
+
const dir = path.dirname(UPDATE_CHECK_FILE)
|
|
1051
|
+
if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true })
|
|
1052
|
+
fs.writeFileSync(UPDATE_CHECK_FILE, JSON.stringify({ latest: newPkg.version, checkedAt: Date.now() }))
|
|
1053
|
+
} catch {
|
|
1054
|
+
try { fs.unlinkSync(UPDATE_CHECK_FILE) } catch {}
|
|
1055
|
+
}
|
|
1049
1056
|
|
|
1050
1057
|
console.log('\nStarting Squeezr...')
|
|
1051
|
-
//
|
|
1052
|
-
|
|
1058
|
+
// Resolve the updated binary from npm global path (process.argv[1] may still be the old version)
|
|
1059
|
+
let newBin = process.argv[1]
|
|
1060
|
+
try {
|
|
1061
|
+
const resolved = execSync('which squeezr', { encoding: 'utf-8', stdio: ['pipe', 'pipe', 'pipe'] }).trim()
|
|
1062
|
+
if (resolved) newBin = resolved
|
|
1063
|
+
} catch {}
|
|
1053
1064
|
try {
|
|
1054
|
-
execSync(`node "${
|
|
1065
|
+
execSync(`node "${newBin}" start`, { stdio: 'inherit' })
|
|
1055
1066
|
} catch {}
|
|
1056
1067
|
|
|
1057
1068
|
if (isWSL()) {
|
|
@@ -1109,4 +1120,4 @@ switch (command) {
|
|
|
1109
1120
|
process.exit(1)
|
|
1110
1121
|
}
|
|
1111
1122
|
|
|
1112
|
-
await showUpdateBanner()
|
|
1123
|
+
if (command !== 'update') await showUpdateBanner()
|
package/package.json
CHANGED