Skip to content

Commit 2768cf8

Browse files
anshmajumdar121claude
andcommitted
fix: replace literal newlines with \n escapes in bin/cli.js, bump 1.0.3
Single-quoted strings with literal newlines are invalid JS — caused SyntaxError on npx run. Fixed all console.log calls to use \n. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent c7a2521 commit 2768cf8

2 files changed

Lines changed: 12 additions & 21 deletions

File tree

bin/cli.js

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function detect(dir) {
2525
return 'claude';
2626
}
2727

28-
const projectPath = process.argv[2] || ".";
28+
const projectPath = process.argv[2] || '.';
2929
const resolvedPath = path.resolve(projectPath);
3030

3131
if (!fs.existsSync(resolvedPath)) {
@@ -42,33 +42,24 @@ if (!fs.existsSync(skillSrc)) {
4242
process.exit(1);
4343
}
4444

45-
const skill = fs.readFileSync(skillSrc, "utf8");
45+
const skill = fs.readFileSync(skillSrc, 'utf8');
4646
fs.mkdirSync(path.dirname(dest), { recursive: true });
4747

48-
if (editor === "claude" && fs.existsSync(dest)) {
49-
const existing = fs.readFileSync(dest, "utf8");
50-
if (existing.includes("CONTEXT_MANIFEST.md")) {
51-
console.log('
52-
Already installed in', path.relative(resolvedPath, dest));
48+
if (editor === 'claude' && fs.existsSync(dest)) {
49+
const existing = fs.readFileSync(dest, 'utf8');
50+
if (existing.includes('CONTEXT_MANIFEST.md')) {
51+
console.log('\n Already installed in', path.relative(resolvedPath, dest));
5352
} else {
54-
fs.appendFileSync(dest, "
55-
56-
" + skill);
57-
console.log('
58-
Appended to', path.relative(resolvedPath, dest));
53+
fs.appendFileSync(dest, '\n\n' + skill);
54+
console.log('\n Appended to', path.relative(resolvedPath, dest));
5955
}
6056
} else {
6157
fs.writeFileSync(dest, skill);
62-
console.log('
63-
Written to', path.relative(resolvedPath, dest));
58+
console.log('\n Written to', path.relative(resolvedPath, dest));
6459
}
6560

6661
console.log(' Editor: ', EDITOR_NAMES[editor]);
6762
console.log(' Project: ', resolvedPath);
68-
console.log('
69-
Next generate your manifest:
70-
');
63+
console.log('\nNext — generate your manifest:\n');
7164
console.log(' python3 tools/context_mapper.py', resolvedPath);
72-
console.log('
73-
Then upload CONTEXT_MANIFEST.md to your Claude Project or paste into chat.
74-
');
65+
console.log('\nThen upload CONTEXT_MANIFEST.md to your Claude Project or paste into chat.\n');

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@anshmaj121/context-optimizer",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"description": "Zero-install context discipline for Claude. 5-27x fewer tokens.",
55
"bin": {
66
"context-optimizer": "bin/cli.js"

0 commit comments

Comments
 (0)