@@ -374,10 +374,10 @@ export class Winboat {
374374
375375 async getContainerStatus ( ) {
376376 try {
377- const { stdout : _containerStatus } = await execAsync ( `docker inspect --format="{{.State.Status}}" WinBoat` ) ;
377+ const { stdout : _containerStatus } = await execAsync ( `${ this . #wbConfig ! . config . containerRuntime } inspect --format="{{.State.Status}}" WinBoat` ) ;
378378 return _containerStatus . trim ( ) as ContainerStatusValue ;
379379 } catch ( e ) {
380- console . error ( " Failed to get container status, most likely we are in the process of resetting" ) ;
380+ console . error ( ` Failed to get container status, most likely we are in the process of resetting ${ this . #wbConfig ! . config . containerRuntime } ` ) ;
381381 return ContainerStatus . Dead ;
382382 }
383383 }
@@ -448,7 +448,7 @@ export class Winboat {
448448 logger . info ( "Starting WinBoat container..." ) ;
449449 this . containerActionLoading . value = true ;
450450 try {
451- const { stdout } = await execAsync ( "docker container start WinBoat" ) ;
451+ const { stdout } = await execAsync ( ` ${ this . #wbConfig ! . config . containerRuntime } container start WinBoat` ) ;
452452 logger . info ( `Container response: ${ stdout } ` ) ;
453453 } catch ( e ) {
454454 logger . error ( "There was an error performing the container action." ) ;
@@ -463,7 +463,7 @@ export class Winboat {
463463 logger . info ( "Stopping WinBoat container..." ) ;
464464 this . containerActionLoading . value = true ;
465465 try {
466- const { stdout } = await execAsync ( "docker container stop WinBoat" ) ;
466+ const { stdout } = await execAsync ( ` ${ this . #wbConfig ! . config . containerRuntime } container stop WinBoat` ) ;
467467 logger . info ( `Container response: ${ stdout } ` ) ;
468468 } catch ( e ) {
469469 logger . error ( "There was an error performing the container action." ) ;
@@ -478,7 +478,7 @@ export class Winboat {
478478 logger . info ( "Pausing WinBoat container..." ) ;
479479 this . containerActionLoading . value = true ;
480480 try {
481- const { stdout } = await execAsync ( "docker container pause WinBoat" ) ;
481+ const { stdout } = await execAsync ( ` ${ this . #wbConfig ! . config . containerRuntime } container pause WinBoat` ) ;
482482 logger . info ( `Container response: ${ stdout } ` ) ;
483483 // TODO: The heartbeat check should set this, but it doesn't because normal fetch timeout doesn't exist
484484 // Fix it once you change fetch to something else
@@ -496,7 +496,7 @@ export class Winboat {
496496 logger . info ( "Unpausing WinBoat container..." ) ;
497497 this . containerActionLoading . value = true ;
498498 try {
499- const { stdout } = await execAsync ( "docker container unpause WinBoat" ) ;
499+ const { stdout } = await execAsync ( ` ${ this . #wbConfig ! . config . containerRuntime } container unpause WinBoat` ) ;
500500 logger . info ( `Container response: ${ stdout } ` ) ;
501501 } catch ( e ) {
502502 logger . error ( "There was an error performing the container action." ) ;
@@ -519,7 +519,7 @@ export class Winboat {
519519 }
520520
521521 // 1. Compose down the current container
522- await execAsync ( `docker compose -f ${ composeFilePath } down` ) ;
522+ await execAsync ( `${ this . #wbConfig ! . config . containerRuntime } compose -f ${ composeFilePath } down` ) ;
523523
524524 // 2. Create a backup directory if it doesn't exist
525525 const backupDir = path . join ( WINBOAT_DIR , 'backup' ) ;
@@ -539,7 +539,7 @@ export class Winboat {
539539 logger . info ( `Wrote new compose file to: ${ composeFilePath } ` ) ;
540540
541541 // 5. Deploy the container with the new compose file
542- await execAsync ( `docker compose -f ${ composeFilePath } up -d` ) ;
542+ await execAsync ( `${ this . #wbConfig ! . config . containerRuntime } compose -f ${ composeFilePath } up -d` ) ;
543543
544544 logger . info ( "Replace compose config completed, successfully deployed new container" ) ;
545545
@@ -554,15 +554,15 @@ export class Winboat {
554554 console . info ( "Stopped container" ) ;
555555
556556 // 2. Remove the container
557- await execAsync ( "docker rm WinBoat" )
557+ await execAsync ( ` ${ this . #wbConfig ! . config . containerRuntime } rm WinBoat` )
558558 console . info ( "Removed container" )
559559
560560 // 3. Remove the container volume or folder
561561 const compose = this . parseCompose ( ) ;
562562 const storage = compose . services . windows . volumes . find ( vol => vol . includes ( '/storage' ) ) ;
563563 if ( storage ?. startsWith ( "data:" ) ) {
564564 // In this case we have a volume (legacy)
565- await execAsync ( "docker volume rm winboat_data" ) ;
565+ await execAsync ( ` ${ this . #wbConfig ! . config . containerRuntime } volume rm winboat_data` ) ;
566566 console . info ( "Removed volume" ) ;
567567 } else {
568568 const storageFolder = storage ?. split ( ":" ) . at ( 0 ) ?? null ;
@@ -716,4 +716,4 @@ export class Winboat {
716716 get hasQMPInterval ( ) {
717717 return this . #qmpInterval !== null ;
718718 }
719- }
719+ }
0 commit comments