mirror of
https://github.com/Piebald-AI/claude-code-system-prompts.git
synced 2026-05-30 05:35:24 +08:00
Cross-platform
This commit is contained in:
parent
a911359efb
commit
6bf1af312d
@ -21,8 +21,17 @@ if (!ANTHROPIC_API_KEY) {
|
|||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
const readFileSync = (file) => readFileSyncOrig(file, 'utf-8').replace(/\r\n/g, "\n");
|
const isWindows = process.platform === 'win32';
|
||||||
const writeFileSync = (file, content) => writeFileSyncOrig(file, content.replace(/\n/g, "\r\n"));
|
|
||||||
|
const readFileSync = (file) => {
|
||||||
|
const content = readFileSyncOrig(file, 'utf-8');
|
||||||
|
return isWindows ? content.replace(/\r\n/g, "\n") : content;
|
||||||
|
};
|
||||||
|
|
||||||
|
const writeFileSync = (file, content) => {
|
||||||
|
const output = isWindows ? content.replace(/\n/g, "\r\n") : content;
|
||||||
|
writeFileSyncOrig(file, output);
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Count tokens using Anthropic's token counting API
|
* Count tokens using Anthropic's token counting API
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user