Skip to content

Commit 450e3ac

Browse files
authored
Merge pull request #111 from GoldenLabHuji:diff_os_support
Diff_os_support
2 parents 9d9129e + d52afa5 commit 450e3ac

5 files changed

Lines changed: 40509 additions & 11 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,3 +135,5 @@ dist
135135
.yarn/build-state.yml
136136
.yarn/install-state.gz
137137
.pnp.*
138+
139+
dbbotUI

classes/app.ts

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,26 @@ export class App {
1212

1313
public deploy(bot: DBbot): void {
1414
this.generateConfigFile(bot);
15-
try {
16-
spawn("sh", ["deploy.sh"], {
17-
cwd: process.cwd(),
18-
});
19-
} catch (error) {
20-
console.error("Error while deploying the bot", error);
15+
16+
let shell: string;
17+
let args: string[];
18+
19+
if (process.platform === "win32") {
20+
// Try Git Bash path (adjust if needed)
21+
shell = "C:\\Program Files\\Git\\bin\\bash.exe";
22+
args = ["deploy.sh"];
23+
} else {
24+
shell = "sh";
25+
args = ["deploy.sh"];
2126
}
27+
28+
const child = spawn(shell, args, {
29+
cwd: process.cwd(),
30+
stdio: "inherit",
31+
});
32+
33+
child.on("error", (error) => {
34+
console.error("Error while deploying the bot:", error);
35+
});
2236
}
2337
}

0 commit comments

Comments
 (0)