@devness/useai-cli 0.4.11 → 0.4.12
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/dist/index.js +8 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -30,7 +30,7 @@ var SYSTEMD_SERVICE_PATH = join(homedir(), ".config", "systemd", "user", "useai-
|
|
|
30
30
|
var WINDOWS_STARTUP_SCRIPT_PATH = join(process.env["APPDATA"] ?? join(homedir(), "AppData", "Roaming"), "Microsoft", "Windows", "Start Menu", "Programs", "Startup", "useai-daemon.vbs");
|
|
31
31
|
|
|
32
32
|
// ../shared/dist/constants/version.js
|
|
33
|
-
var VERSION = "0.4.
|
|
33
|
+
var VERSION = "0.4.12";
|
|
34
34
|
|
|
35
35
|
// ../shared/dist/constants/defaults.js
|
|
36
36
|
var DEFAULT_CONFIG = {
|
|
@@ -5244,11 +5244,17 @@ function injectInstructions(config) {
|
|
|
5244
5244
|
writeFileSync4(config.path, USEAI_INSTRUCTIONS + "\n");
|
|
5245
5245
|
return;
|
|
5246
5246
|
}
|
|
5247
|
-
if (hasInstructionsBlock(config.path)) return;
|
|
5248
5247
|
let existing = "";
|
|
5249
5248
|
if (existsSync8(config.path)) {
|
|
5250
5249
|
existing = readFileSync4(config.path, "utf-8");
|
|
5251
5250
|
}
|
|
5251
|
+
if (hasInstructionsBlock(config.path)) {
|
|
5252
|
+
const pattern = new RegExp(
|
|
5253
|
+
`${INSTRUCTIONS_START}[\\s\\S]*?${INSTRUCTIONS_END}`
|
|
5254
|
+
);
|
|
5255
|
+
writeFileSync4(config.path, existing.replace(pattern, USEAI_INSTRUCTIONS_BLOCK));
|
|
5256
|
+
return;
|
|
5257
|
+
}
|
|
5252
5258
|
const separator = existing && !existing.endsWith("\n") ? "\n\n" : existing ? "\n" : "";
|
|
5253
5259
|
writeFileSync4(config.path, existing + separator + USEAI_INSTRUCTIONS_BLOCK + "\n");
|
|
5254
5260
|
}
|