Skip to content

Commit 9fa620c

Browse files
committed
Update self-uninstall
Signed-off-by: Riddhesh Sanghvi <[email protected]>
1 parent 94a1fd3 commit 9fa620c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

php/commands/src/CLI_Command.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -502,18 +502,19 @@ public function self_uninstall( $args, $assoc_args ) {
502502
EE::confirm( "Are you sure you want to remove EasyEngine and all its sites(along with their data)?\nThis is an irreversible action. No backup will be kept.", $assoc_args );
503503

504504
EE::exec( 'docker rm -f $(docker ps -aqf label=org.label-schema.vendor="EasyEngine")' );
505-
$home = Utils\get_home_dir();
506-
EE::exec( "rm -rf $home/.ee/" );
505+
EE::exec( 'docker network prune -f $(docker network ls -f "label=org.label-schema.vendor=EasyEngine")' );
506+
EE::exec( 'docker volume rm -f $(docker volume ls -f "label=org.label-schema.vendor=EasyEngine" -q)' );
507+
EE::exec( 'docker image rm $(docker image ls -f "label=org.label-schema.vendor=EasyEngine" -q)' );
507508

508509
$records = Site::all( [ 'site_fs_path' ] );
509510

511+
$fs = new Filesystem();
510512
if ( ! empty( $records ) ) {
511513
$sites_paths = array_column( $records, 'site_fs_path' );
512-
$fs = new Filesystem();
513514
$fs->remove( $sites_paths );
514515
}
515516

516-
EE::exec( "rm -rf " . EE_ROOT_DIR );
517+
$fs->remove( EE_ROOT_DIR );
517518

518519
if ( Utils\inside_phar() ) {
519520
unlink( realpath( $_SERVER['argv'][0] ) );

0 commit comments

Comments
 (0)