Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,5 @@ dist
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

dbbotUI
26 changes: 20 additions & 6 deletions classes/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,26 @@ export class App {

public deploy(bot: DBbot): void {
this.generateConfigFile(bot);
try {
spawn("sh", ["deploy.sh"], {
cwd: process.cwd(),
});
} catch (error) {
console.error("Error while deploying the bot", error);

let shell: string;
let args: string[];

if (process.platform === "win32") {
// Try Git Bash path (adjust if needed)
shell = "C:\\Program Files\\Git\\bin\\bash.exe";
args = ["deploy.sh"];
} else {
shell = "sh";
args = ["deploy.sh"];
}

const child = spawn(shell, args, {
cwd: process.cwd(),
stdio: "inherit",
});

child.on("error", (error) => {
console.error("Error while deploying the bot:", error);
});
}
}
Loading