codexport 0.1.2 → 0.1.4
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 +7 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { Command, Option } from "commander";
|
|
|
3
3
|
import chokidar from "chokidar";
|
|
4
4
|
import { createHash, randomBytes } from "node:crypto";
|
|
5
5
|
import { createServer, request } from "node:http";
|
|
6
|
-
import { mkdir, readFile, readdir, readlink, rename, rm, stat, symlink, writeFile } from "node:fs/promises";
|
|
6
|
+
import { lstat, mkdir, readFile, readdir, readlink, rename, rm, stat, symlink, writeFile } from "node:fs/promises";
|
|
7
7
|
import { existsSync } from "node:fs";
|
|
8
8
|
import { realpathSync } from "node:fs";
|
|
9
9
|
import { fileURLToPath } from "node:url";
|
|
@@ -11,7 +11,7 @@ import { homedir, platform } from "node:os";
|
|
|
11
11
|
import path from "node:path";
|
|
12
12
|
import { spawn } from "node:child_process";
|
|
13
13
|
import { parse as parseToml, stringify as stringifyToml } from "smol-toml";
|
|
14
|
-
const VERSION = "0.1.
|
|
14
|
+
const VERSION = "0.1.4";
|
|
15
15
|
const DEFAULT_PORT = 17342;
|
|
16
16
|
const DEFAULT_TIMEOUT_MS = 5_000;
|
|
17
17
|
const CODEXPORT_DIR = ".codexport";
|
|
@@ -187,7 +187,10 @@ async function walkIncluded(root, absolute, files) {
|
|
|
187
187
|
const relative = normalizeRelative(path.relative(root, absolute));
|
|
188
188
|
if (!relative || shouldExclude(relative))
|
|
189
189
|
return;
|
|
190
|
-
const entryStat = await
|
|
190
|
+
const entryStat = await lstat(absolute);
|
|
191
|
+
if (entryStat.isSymbolicLink()) {
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
191
194
|
if (entryStat.isDirectory()) {
|
|
192
195
|
const children = await readdir(absolute);
|
|
193
196
|
for (const child of children) {
|
|
@@ -457,7 +460,7 @@ function runCommand(command, args) {
|
|
|
457
460
|
});
|
|
458
461
|
}
|
|
459
462
|
async function installMasterService(ctx, port, dryRun) {
|
|
460
|
-
const command =
|
|
463
|
+
const command = `${process.execPath} ${realpathSync(fileURLToPath(import.meta.url))} master serve --port ${port}`;
|
|
461
464
|
if (platform() === "linux") {
|
|
462
465
|
const unitDir = path.join(ctx.homeDir, ".config", "systemd", "user");
|
|
463
466
|
const unitPath = path.join(unitDir, "codexport-master.service");
|