File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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+ }
You can’t perform that action at this time.
0 commit comments