@engineeros/connector 0.4.6 → 0.4.7
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/package.json +1 -1
- package/src/runner.mjs +22 -21
package/package.json
CHANGED
package/src/runner.mjs
CHANGED
|
@@ -585,20 +585,17 @@ function runCodexCommand(command, args, cwd) {
|
|
|
585
585
|
async function changedFilePaths(workspace) {
|
|
586
586
|
const tracked = await run(
|
|
587
587
|
"git",
|
|
588
|
-
["diff", "--name-only", "HEAD", "--"],
|
|
588
|
+
["diff", "--name-only", "-z", "HEAD", "--"],
|
|
589
589
|
workspace,
|
|
590
590
|
);
|
|
591
591
|
const untracked = await run(
|
|
592
592
|
"git",
|
|
593
|
-
["ls-files", "--others", "--exclude-standard"],
|
|
593
|
+
["ls-files", "-z", "--others", "--exclude-standard"],
|
|
594
594
|
workspace,
|
|
595
595
|
);
|
|
596
596
|
return [
|
|
597
597
|
...new Set(
|
|
598
|
-
|
|
599
|
-
.split(/\r?\n/)
|
|
600
|
-
.map(normalizePath)
|
|
601
|
-
.filter(Boolean),
|
|
598
|
+
[...gitPathList(tracked.stdout), ...gitPathList(untracked.stdout)],
|
|
602
599
|
),
|
|
603
600
|
].sort();
|
|
604
601
|
}
|
|
@@ -610,16 +607,15 @@ async function boundedDiff(workspace, changedFiles) {
|
|
|
610
607
|
workspace,
|
|
611
608
|
);
|
|
612
609
|
const untracked = new Set(
|
|
613
|
-
(
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
.
|
|
621
|
-
|
|
622
|
-
.filter(Boolean),
|
|
610
|
+
gitPathList(
|
|
611
|
+
(
|
|
612
|
+
await run(
|
|
613
|
+
"git",
|
|
614
|
+
["ls-files", "-z", "--others", "--exclude-standard"],
|
|
615
|
+
workspace,
|
|
616
|
+
)
|
|
617
|
+
).stdout,
|
|
618
|
+
),
|
|
623
619
|
);
|
|
624
620
|
const parts = [tracked.stdout];
|
|
625
621
|
for (const relative of changedFiles.filter((item) => untracked.has(item))) {
|
|
@@ -638,15 +634,13 @@ async function boundedDiff(workspace, changedFiles) {
|
|
|
638
634
|
return diff;
|
|
639
635
|
}
|
|
640
636
|
|
|
641
|
-
async function repositoryArchive(workspace) {
|
|
637
|
+
export async function repositoryArchive(workspace) {
|
|
642
638
|
const listed = await run(
|
|
643
639
|
"git",
|
|
644
|
-
["ls-files", "-co", "--exclude-standard"],
|
|
640
|
+
["ls-files", "-z", "-co", "--exclude-standard"],
|
|
645
641
|
workspace,
|
|
646
642
|
);
|
|
647
|
-
const files = [
|
|
648
|
-
...new Set(listed.stdout.split(/\r?\n/).map(normalizePath).filter(Boolean)),
|
|
649
|
-
].sort();
|
|
643
|
+
const files = [...new Set(gitPathList(listed.stdout))].sort();
|
|
650
644
|
return createZip(
|
|
651
645
|
await Promise.all(
|
|
652
646
|
files.map(async (relative) => ({
|
|
@@ -801,6 +795,13 @@ function normalizePath(value) {
|
|
|
801
795
|
.replace(/^\.\//, "");
|
|
802
796
|
}
|
|
803
797
|
|
|
798
|
+
function gitPathList(value) {
|
|
799
|
+
return String(value ?? "")
|
|
800
|
+
.split("\0")
|
|
801
|
+
.map(normalizePath)
|
|
802
|
+
.filter(Boolean);
|
|
803
|
+
}
|
|
804
|
+
|
|
804
805
|
function run(command, args, cwd, options = {}) {
|
|
805
806
|
return new Promise((resolve, reject) => {
|
|
806
807
|
const child = spawn(command, args, {
|