staklink 0.3.59 → 0.3.60
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/proxy-server.cjs +0 -54
- package/package.json +1 -1
package/dist/proxy-server.cjs
CHANGED
|
@@ -56695,40 +56695,6 @@ var Repo = class {
|
|
|
56695
56695
|
}
|
|
56696
56696
|
}
|
|
56697
56697
|
}
|
|
56698
|
-
async stashDevcontainer() {
|
|
56699
|
-
try {
|
|
56700
|
-
const devcontainerPath = path7.join(this.cwd, ".devcontainer");
|
|
56701
|
-
const backupPath = path7.join(this.cwd, "..", ".devcontainer_tmp");
|
|
56702
|
-
await fs8.access(devcontainerPath);
|
|
56703
|
-
try {
|
|
56704
|
-
await fs8.rm(backupPath, { recursive: true, force: true });
|
|
56705
|
-
} catch {
|
|
56706
|
-
}
|
|
56707
|
-
await fs8.rename(devcontainerPath, backupPath);
|
|
56708
|
-
return true;
|
|
56709
|
-
} catch (error48) {
|
|
56710
|
-
return false;
|
|
56711
|
-
}
|
|
56712
|
-
}
|
|
56713
|
-
async popDevcontainerStash() {
|
|
56714
|
-
try {
|
|
56715
|
-
const devcontainerPath = path7.join(this.cwd, ".devcontainer");
|
|
56716
|
-
const backupPath = path7.join(this.cwd, "..", ".devcontainer_tmp");
|
|
56717
|
-
await fs8.access(backupPath);
|
|
56718
|
-
try {
|
|
56719
|
-
await fs8.rm(devcontainerPath, { recursive: true, force: true });
|
|
56720
|
-
} catch {
|
|
56721
|
-
}
|
|
56722
|
-
await fs8.rename(backupPath, devcontainerPath);
|
|
56723
|
-
} catch (error48) {
|
|
56724
|
-
warn("Failed to restore .devcontainer:", error48);
|
|
56725
|
-
try {
|
|
56726
|
-
const backupPath = path7.join(this.cwd, "..", ".devcontainer_tmp");
|
|
56727
|
-
await fs8.rm(backupPath, { recursive: true, force: true });
|
|
56728
|
-
} catch {
|
|
56729
|
-
}
|
|
56730
|
-
}
|
|
56731
|
-
}
|
|
56732
56698
|
async resetHard(hash2) {
|
|
56733
56699
|
if (hash2) {
|
|
56734
56700
|
return this.execCommand(`git reset ${hash2} --hard`);
|
|
@@ -102770,7 +102736,6 @@ async function startProxyServer() {
|
|
|
102770
102736
|
for (const r of repos) {
|
|
102771
102737
|
const repo = await NewRepo(r);
|
|
102772
102738
|
const repoName = getRepoNameFromUrl(r);
|
|
102773
|
-
const stashCreated = await repo.stashDevcontainer();
|
|
102774
102739
|
const diffOutput = await repo.execCommand(
|
|
102775
102740
|
"git diff --name-status HEAD"
|
|
102776
102741
|
);
|
|
@@ -102837,9 +102802,6 @@ ${lines2.map((line) => "+" + line).join("\n")}`;
|
|
|
102837
102802
|
errors: []
|
|
102838
102803
|
});
|
|
102839
102804
|
}
|
|
102840
|
-
if (stashCreated) {
|
|
102841
|
-
await repo.popDevcontainerStash();
|
|
102842
|
-
}
|
|
102843
102805
|
}
|
|
102844
102806
|
res.status(200).json(results);
|
|
102845
102807
|
} catch (error48) {
|
|
@@ -102867,7 +102829,6 @@ ${lines2.map((line) => "+" + line).join("\n")}`;
|
|
|
102867
102829
|
log(`=> CHECKOUT to new branch: ${repodata.branch_name}`);
|
|
102868
102830
|
await repo.checkoutNew(repodata.branch_name);
|
|
102869
102831
|
}
|
|
102870
|
-
const stashCreated = await repo.stashDevcontainer();
|
|
102871
102832
|
await repo.addAll();
|
|
102872
102833
|
log(
|
|
102873
102834
|
`=> COMMIT to ${repodata.url} new branch: ${repodata.branch_name}`
|
|
@@ -102876,9 +102837,6 @@ ${lines2.map((line) => "+" + line).join("\n")}`;
|
|
|
102876
102837
|
repodata.commit_name,
|
|
102877
102838
|
code.git_credentials
|
|
102878
102839
|
);
|
|
102879
|
-
if (stashCreated) {
|
|
102880
|
-
await repo.popDevcontainerStash();
|
|
102881
|
-
}
|
|
102882
102840
|
}
|
|
102883
102841
|
res.json({ success: true });
|
|
102884
102842
|
} catch (e) {
|
|
@@ -102909,7 +102867,6 @@ ${lines2.map((line) => "+" + line).join("\n")}`;
|
|
|
102909
102867
|
for (const r of repos) {
|
|
102910
102868
|
const repo = await NewRepo(r.url);
|
|
102911
102869
|
const repoName = getRepoNameFromUrl(r.url);
|
|
102912
|
-
const stashCreated = await repo.stashDevcontainer();
|
|
102913
102870
|
let currentBranch = (await repo.printCurrentBranch()).trim();
|
|
102914
102871
|
const requestedBranch = stayOnCurrentBranch ? currentBranch : await repo.generateUniqueBranchName(r.branch_name);
|
|
102915
102872
|
log(`=> Current branch: ${currentBranch}`);
|
|
@@ -102959,9 +102916,6 @@ ${lines2.map((line) => "+" + line).join("\n")}`;
|
|
|
102959
102916
|
currentBranch = (await repo.printCurrentBranch()).trim();
|
|
102960
102917
|
branches[repoName] = currentBranch;
|
|
102961
102918
|
log(`=> Branch for ${repoName}: ${currentBranch}`);
|
|
102962
|
-
if (stashCreated) {
|
|
102963
|
-
await repo.popDevcontainerStash();
|
|
102964
|
-
}
|
|
102965
102919
|
if (createPR) {
|
|
102966
102920
|
if (!code.git_credentials?.auth_data?.token) {
|
|
102967
102921
|
error(`=> No GitHub token available for PR creation`);
|
|
@@ -103088,14 +103042,10 @@ ${diff.trim()}`);
|
|
|
103088
103042
|
const code = req.body;
|
|
103089
103043
|
for (const r of code.repos) {
|
|
103090
103044
|
const repo = await NewRepo(r.url);
|
|
103091
|
-
const stashCreated = await repo.stashDevcontainer();
|
|
103092
103045
|
await repo.checkoutMainBranchOrBaseBranch(r.base_branch);
|
|
103093
103046
|
await repo.fetchLatestWithCredentials(code.git_credentials);
|
|
103094
103047
|
await repo.resetHardOriginWithCredentials(r.base_branch);
|
|
103095
103048
|
await repo.clean();
|
|
103096
|
-
if (stashCreated) {
|
|
103097
|
-
await repo.popDevcontainerStash();
|
|
103098
|
-
}
|
|
103099
103049
|
}
|
|
103100
103050
|
res.json({ success: true });
|
|
103101
103051
|
} catch (e) {
|
|
@@ -103318,14 +103268,10 @@ ${diff.trim()}`);
|
|
|
103318
103268
|
log("=> LATEST: Running reset...");
|
|
103319
103269
|
for (const r of code.repos) {
|
|
103320
103270
|
const repo = await NewRepo(r.url);
|
|
103321
|
-
const stashCreated = await repo.stashDevcontainer();
|
|
103322
103271
|
await repo.checkoutMainBranchOrBaseBranch(r.base_branch);
|
|
103323
103272
|
await repo.fetchLatestWithCredentials(code.git_credentials);
|
|
103324
103273
|
await repo.resetHardOriginWithCredentials(r.base_branch);
|
|
103325
103274
|
await repo.clean();
|
|
103326
|
-
if (stashCreated) {
|
|
103327
|
-
await repo.popDevcontainerStash();
|
|
103328
|
-
}
|
|
103329
103275
|
}
|
|
103330
103276
|
log("=> LATEST: Running install...");
|
|
103331
103277
|
let config3 = await findAndLoadPm2Config(workspaceRoot2, log);
|