mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Merge pull request #230 from YunoHost/ynh_no_log
Hack dégueux pour éviter d'écrire dans le log cli
This commit is contained in:
commit
cf3f0e8185
1 changed files with 13 additions and 0 deletions
|
@ -4,3 +4,16 @@ ynh_die() {
|
||||||
echo "$1" 1>&2
|
echo "$1" 1>&2
|
||||||
exit "${2:-1}"
|
exit "${2:-1}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Ignore the yunohost-cli log to prevent errors with conditionals commands
|
||||||
|
# usage: ynh_no_log COMMAND
|
||||||
|
# Simply duplicate the log, execute the yunohost command and replace the log without the result of this command
|
||||||
|
# It's a very badly hack...
|
||||||
|
ynh_no_log() {
|
||||||
|
ynh_cli_log=/var/log/yunohost/yunohost-cli.log
|
||||||
|
sudo cp -a ${ynh_cli_log} ${ynh_cli_log}-move
|
||||||
|
eval $@
|
||||||
|
exit_code=$?
|
||||||
|
sudo mv ${ynh_cli_log}-move ${ynh_cli_log}
|
||||||
|
return $?
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue