mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
ynh_safe_rm: Check if target is a symlink
When calling ynh_safe_rm to a broken symlink, the function was erroring out. (test -e was following the symlink and returning false) We need to also check if it is a symlink before exiting.
This commit is contained in:
parent
87eedc2a36
commit
650481a58a
1 changed files with 1 additions and 1 deletions
|
@ -168,7 +168,7 @@ ynh_safe_rm() {
|
|||
|
||||
if [[ -z "$target" ]]; then
|
||||
ynh_print_warn "ynh_safe_rm called with empty argument, ignoring."
|
||||
elif [[ ! -e $target ]]; then
|
||||
elif [[ ! -e "$target" ]] && [[ ! -L "$target" ]]; then
|
||||
ynh_print_info "'$target' wasn't deleted because it doesn't exist."
|
||||
elif ! _acceptable_path_to_delete "$target"; then
|
||||
ynh_print_warn "Not deleting '$target' because it is not an acceptable path to delete."
|
||||
|
|
Loading…
Add table
Reference in a new issue