Commit 72b935f4 authored by Marius Burkard's avatar Marius Burkard

- added --force option for addon installer

parent ad447c27
...@@ -44,6 +44,7 @@ if(!isset($_SERVER['argv'])) { ...@@ -44,6 +44,7 @@ if(!isset($_SERVER['argv'])) {
$action = ''; $action = '';
$package = ''; $package = '';
$force = false;
$argv = $_SERVER['argv']; $argv = $_SERVER['argv'];
for($a = 1; $a < count($argv); $a++) { for($a = 1; $a < count($argv); $a++) {
...@@ -52,6 +53,8 @@ for($a = 1; $a < count($argv); $a++) { ...@@ -52,6 +53,8 @@ for($a = 1; $a < count($argv); $a++) {
$action = 'install'; $action = 'install';
} elseif($argv[$a] === '--uninstall' || $argv[$a] === 'uninstall') { } elseif($argv[$a] === '--uninstall' || $argv[$a] === 'uninstall') {
$action = 'uninstall'; $action = 'uninstall';
} elseif($argv[$a] === '--force') {
$force = true;
} elseif(substr($argv[$a], -4) === '.pkg' && is_file($argv[$a])) { } elseif(substr($argv[$a], -4) === '.pkg' && is_file($argv[$a])) {
$package = $argv[$a]; $package = $argv[$a];
} else { } else {
...@@ -63,7 +66,7 @@ if($action == 'uninstall') { ...@@ -63,7 +66,7 @@ if($action == 'uninstall') {
die('Automatic uninstall not supported, yet.'); die('Automatic uninstall not supported, yet.');
} else { } else {
try { try {
$app->addon_installer->installAddon($package); $app->addon_installer->installAddon($package, $force);
} catch(Exception $e) { } catch(Exception $e) {
die('Error: ' . $e->getMessage() . "\n"); die('Error: ' . $e->getMessage() . "\n");
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment