poe-code 3.0.239 → 3.0.240
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 +12 -3
- package/dist/index.js.map +2 -2
- package/dist/metafile.json +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -68298,6 +68298,7 @@ function getRotatedLogPath(logDir, stream, index) {
|
|
|
68298
68298
|
}
|
|
68299
68299
|
async function isFile(fs27, filePath) {
|
|
68300
68300
|
try {
|
|
68301
|
+
await assertPathHasNoSymbolicLinks(fs27, filePath);
|
|
68301
68302
|
return (await fs27.stat(filePath)).isFile();
|
|
68302
68303
|
} catch (error3) {
|
|
68303
68304
|
if (isNotFoundError6(error3)) {
|
|
@@ -68316,6 +68317,7 @@ async function moveIfExists(fs27, sourcePath, destinationPath) {
|
|
|
68316
68317
|
if (!await isFile(fs27, sourcePath)) {
|
|
68317
68318
|
return;
|
|
68318
68319
|
}
|
|
68320
|
+
await assertPathHasNoSymbolicLinks(fs27, destinationPath);
|
|
68319
68321
|
const content = await fs27.readFile(sourcePath, "utf8");
|
|
68320
68322
|
await fs27.writeFile(destinationPath, content);
|
|
68321
68323
|
await fs27.rm(sourcePath, { force: true });
|
|
@@ -68378,7 +68380,9 @@ function createLogWriter(logDir, retainCount, fs27 = nodeFs8) {
|
|
|
68378
68380
|
await assertPathHasNoSymbolicLinks(fs27, logDir);
|
|
68379
68381
|
await fs27.mkdir(logDir, { recursive: true });
|
|
68380
68382
|
await assertPathHasNoSymbolicLinks(fs27, logDir);
|
|
68381
|
-
|
|
68383
|
+
const currentPath = getCurrentLogPath(logDir, stream);
|
|
68384
|
+
await assertPathHasNoSymbolicLinks(fs27, currentPath);
|
|
68385
|
+
await fs27.appendFile(currentPath, `${line}
|
|
68382
68386
|
`);
|
|
68383
68387
|
}
|
|
68384
68388
|
function write2(line, stream) {
|
|
@@ -68420,7 +68424,9 @@ function createLogWriter(logDir, retainCount, fs27 = nodeFs8) {
|
|
|
68420
68424
|
}
|
|
68421
68425
|
try {
|
|
68422
68426
|
await assertPathHasNoSymbolicLinks(fs27, logDir);
|
|
68423
|
-
const
|
|
68427
|
+
const currentPath = getCurrentLogPath(logDir, stream);
|
|
68428
|
+
await assertPathHasNoSymbolicLinks(fs27, currentPath);
|
|
68429
|
+
const content = await fs27.readFile(currentPath, "utf8");
|
|
68424
68430
|
const allLines = getLines(content);
|
|
68425
68431
|
if (lines === 0) {
|
|
68426
68432
|
return [];
|
|
@@ -68456,6 +68462,7 @@ async function captureLogs(fs27, logDir) {
|
|
|
68456
68462
|
continue;
|
|
68457
68463
|
}
|
|
68458
68464
|
const filePath = path94.join(logDir, fileName);
|
|
68465
|
+
await assertPathHasNoSymbolicLinks(fs27, filePath);
|
|
68459
68466
|
snapshot2.set(filePath, await fs27.readFile(filePath, "utf8"));
|
|
68460
68467
|
}
|
|
68461
68468
|
return snapshot2;
|
|
@@ -68473,10 +68480,12 @@ async function restoreLogs(fs27, logDir, snapshot2) {
|
|
|
68473
68480
|
const filePath = path94.join(logDir, fileName);
|
|
68474
68481
|
const managed = fileName === "stdout.log" || fileName === "stderr.log" || getRotatedLogIndex(fileName, "stdout") !== null || getRotatedLogIndex(fileName, "stderr") !== null;
|
|
68475
68482
|
if (managed && !snapshot2.has(filePath)) {
|
|
68483
|
+
await assertPathHasNoSymbolicLinks(fs27, filePath);
|
|
68476
68484
|
await fs27.rm(filePath, { force: true });
|
|
68477
68485
|
}
|
|
68478
68486
|
}
|
|
68479
68487
|
for (const [filePath, content] of snapshot2) {
|
|
68488
|
+
await assertPathHasNoSymbolicLinks(fs27, filePath);
|
|
68480
68489
|
await fs27.writeFile(filePath, content);
|
|
68481
68490
|
}
|
|
68482
68491
|
}
|
|
@@ -123262,7 +123271,7 @@ var init_package2 = __esm({
|
|
|
123262
123271
|
"package.json"() {
|
|
123263
123272
|
package_default2 = {
|
|
123264
123273
|
name: "poe-code",
|
|
123265
|
-
version: "3.0.
|
|
123274
|
+
version: "3.0.240",
|
|
123266
123275
|
description: "CLI tool to configure Poe API for developer workflows.",
|
|
123267
123276
|
type: "module",
|
|
123268
123277
|
main: "./dist/index.js",
|