claude-mem-lite 2.73.0 → 2.73.2
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/hook-update.mjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// Skips in dev mode (symlinked installs). Silent on network failure.
|
|
4
4
|
|
|
5
5
|
import { execSync, execFileSync } from 'node:child_process';
|
|
6
|
-
import { readFileSync, writeFileSync, copyFileSync, cpSync, readdirSync, existsSync, lstatSync, mkdirSync, rmSync, renameSync } from 'node:fs';
|
|
6
|
+
import { readFileSync, writeFileSync, copyFileSync, cpSync, readdirSync, existsSync, lstatSync, mkdirSync, rmSync, renameSync, chmodSync } from 'node:fs';
|
|
7
7
|
import { join, dirname } from 'node:path';
|
|
8
8
|
import { tmpdir, homedir } from 'node:os';
|
|
9
9
|
import { DB_DIR } from './schema.mjs';
|
|
@@ -400,10 +400,19 @@ function copyReleaseIntoStaging(sourceDir, stagingDir) {
|
|
|
400
400
|
const stagedScripts = join(stagingDir, 'scripts');
|
|
401
401
|
if (existsSync(stagedScripts)) {
|
|
402
402
|
for (const sf of readdirSync(stagedScripts).filter(n => n.endsWith('.sh'))) {
|
|
403
|
-
try {
|
|
403
|
+
try { chmodSync(join(stagedScripts, sf), 0o755); } catch (e) { debugCatch(e, 'chmod-script'); }
|
|
404
404
|
}
|
|
405
405
|
}
|
|
406
406
|
|
|
407
|
+
// cli.mjs is invoked via the ~/.local/bin/claude-mem-lite symlink, which needs
|
|
408
|
+
// the target executable. copyFileSync preserves the source mode and git stores
|
|
409
|
+
// cli.mjs as 100644 — without this chmod, auto-update strips the +x bit set by
|
|
410
|
+
// install.mjs:408 and the next CLI invocation dies with "Permission denied".
|
|
411
|
+
const stagedCli = join(stagingDir, 'cli.mjs');
|
|
412
|
+
if (existsSync(stagedCli)) {
|
|
413
|
+
try { chmodSync(stagedCli, 0o755); } catch (e) { debugCatch(e, 'chmod-cli'); }
|
|
414
|
+
}
|
|
415
|
+
|
|
407
416
|
debugLog('DEBUG', 'hook-update', `Auto-update staged ${copied} source files`);
|
|
408
417
|
}
|
|
409
418
|
|