Fixes in scripts for fedora derivatives

This commit is contained in:
absurdo 2023-12-01 23:53:14 +01:00
parent 092a4ee969
commit 4dd7e4531f
4 changed files with 16 additions and 14 deletions

View file

@ -6,7 +6,7 @@ include('leviathanutils/vendor/autoload.php');
$user=get_current_user();
$file_wp='./bin/wp';
$file_wp='/usr/local/bin/wp';
Linux::json_log('Installing WP Wordpress utility...', $error=0, $status=0, $progress=0, $no_progress=1);
@ -14,20 +14,20 @@ if(is_file($file_wp)) {
Linux::json_log('Installed, updating wp...', $error=0, $status=0, $progress=0, $no_progress=1);
Linux::shell_command(['./bin/wp cli update --yes']);
Linux::shell_command(["sudo ${file_wp} cli update --yes"]);
}
else {
/*
if(!is_dir('./bin')) {
mkdir('./bin');
}
}*/
Linux::shell_command(['curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar']);
Linux::shell_command(['chmod +x wp-cli.phar']);
Linux::shell_command(["mv wp-cli.phar ./bin/wp && sudo ln -s /home/${user}/bin/wp /usr/local/bin/wp"]);
Linux::shell_command(["sudo mv wp-cli.phar /usr/local/bin/wp"]);
}