diff --git a/classes/app.ts b/classes/app.ts index 7531625..7c35cae 100644 --- a/classes/app.ts +++ b/classes/app.ts @@ -13,20 +13,28 @@ export class App { public deploy(bot: DBbot): void { this.generateConfigFile(bot); + // Resolve the full path to deploy.sh relative to this file + const scriptPath = path.resolve(__dirname, "..", "deploy.sh"); + + // Check if the script exists + if (!fs.existsSync(scriptPath)) { + console.error("deploy.sh not found at:", scriptPath); + return; + } + let shell: string; let args: string[]; if (process.platform === "win32") { - // Try Git Bash path (adjust if needed) + // Git Bash (adjust path if needed) shell = "C:\\Program Files\\Git\\bin\\bash.exe"; - args = ["deploy.sh"]; + args = [scriptPath]; } else { shell = "sh"; - args = ["deploy.sh"]; + args = [scriptPath]; } const child = spawn(shell, args, { - cwd: process.cwd(), stdio: "inherit", }); @@ -34,4 +42,4 @@ export class App { console.error("Error while deploying the bot:", error); }); } -} +} \ No newline at end of file