diff options
author | zotlabs <mike@macgirvin.com> | 2018-05-05 16:19:23 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2018-05-05 16:19:23 -0700 |
commit | b2218574ee56c1611fa2869c5b2630ff4f41803c (patch) | |
tree | 1d06a26f436918ae4a0b7b5c42f29757a08fc55f /util | |
parent | 70a0a833632fe125306e309414475efedb0e29bc (diff) | |
download | volse-hubzilla-b2218574ee56c1611fa2869c5b2630ff4f41803c.tar.gz volse-hubzilla-b2218574ee56c1611fa2869c5b2630ff4f41803c.tar.bz2 volse-hubzilla-b2218574ee56c1611fa2869c5b2630ff4f41803c.zip |
allow uninstall of plugins which no longer exists via cmdline tool
Diffstat (limited to 'util')
-rwxr-xr-x | util/addons | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/util/addons b/util/addons index 150a7ca09..3d772bf73 100755 --- a/util/addons +++ b/util/addons @@ -106,9 +106,12 @@ if($argc == 3 && $argv[1] === 'install') { if($argc == 3 && $argv[1] === 'uninstall') { + $found = false; + if($plugins) { foreach($plugins as $p) { if($p[0] === $argv[2]) { + $found = true; if(! $p[1]) echo $p[0] . ' not installed.' . "\n"; elseif($p[2]['disabled']) @@ -125,6 +128,17 @@ if($argc == 3 && $argv[1] === 'uninstall') { } } + // force uninstall of addon which no longer exists + + if(! $found) { + $idx = array_search($argv[2], App::$plugins); + if ($idx !== false) + unset(App::$plugins[$idx]); + uninstall_plugin($argv[2]); + set_config("system","addon", implode(", ",App::$plugins)); + echo $argv[2] . ' uninstalled.' . "\n"; + } + killme(); } |