Skip to content

Commit c4eb3d4

Browse files
committed
Fix ee uninstallation as per PR
Signed-off-by: Kirtan Gajjar <[email protected]>
1 parent a03ad8c commit c4eb3d4

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

php/commands/src/CLI_Command.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
22

33
use \Composer\Semver\Comparator;
4+
use \Symfony\Component\Filesystem\Filesystem;
45
use \EE\Utils;
5-
use Mustangostang\Spyc;
66

77
/**
88
* Review current EE info, check for updates, or see defined aliases.
@@ -505,7 +505,16 @@ public function self_uninstall( $args, $assoc_args ) {
505505
Utils\default_launch("docker rm -f $(docker ps -aqf label=org.label-schema.vendor=\"EasyEngine\")");
506506
$home = Utils\get_home_dir();
507507
Utils\default_launch("rm -rf $home/.ee/");
508-
Utils\default_launch("rm -rf $home/ee-sites/");
508+
509+
$records = EE::db()->select(['site_path']);
510+
511+
if( $records !== false ) {
512+
$sites_paths = array_column($records, 'site_path');
513+
$fs = new Filesystem();
514+
$fs->remove($sites_paths);
515+
}
516+
517+
Utils\default_launch("rm -df $home/ee-sites/");
509518
Utils\default_launch("rm -rf /opt/easyengine/");
510519
}
511520

0 commit comments

Comments
 (0)