Skip to content

Commit 73b5255

Browse files
authored
Merge pull request #113 from GoldenLabHuji/diff_os_support
feat: update os
2 parents c5b7d86 + f9464ba commit 73b5255

1 file changed

Lines changed: 13 additions & 5 deletions

File tree

classes/app.ts

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,33 @@ export class App {
1313
public deploy(bot: DBbot): void {
1414
this.generateConfigFile(bot);
1515

16+
// Resolve the full path to deploy.sh relative to this file
17+
const scriptPath = path.resolve(__dirname, "..", "deploy.sh");
18+
19+
// Check if the script exists
20+
if (!fs.existsSync(scriptPath)) {
21+
console.error("deploy.sh not found at:", scriptPath);
22+
return;
23+
}
24+
1625
let shell: string;
1726
let args: string[];
1827

1928
if (process.platform === "win32") {
20-
// Try Git Bash path (adjust if needed)
29+
// Git Bash (adjust path if needed)
2130
shell = "C:\\Program Files\\Git\\bin\\bash.exe";
22-
args = ["deploy.sh"];
31+
args = [scriptPath];
2332
} else {
2433
shell = "sh";
25-
args = ["deploy.sh"];
34+
args = [scriptPath];
2635
}
2736

2837
const child = spawn(shell, args, {
29-
cwd: process.cwd(),
3038
stdio: "inherit",
3139
});
3240

3341
child.on("error", (error) => {
3442
console.error("Error while deploying the bot:", error);
3543
});
3644
}
37-
}
45+
}

0 commit comments

Comments
 (0)