forked from CastroFidel/winehelper
dropped function: check_command
This commit is contained in:
parent
8cc9cb17bb
commit
bd482ea757
22
winehelper
22
winehelper
@ -126,15 +126,6 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
##### HELPER FUNCTIONS #####
|
##### HELPER FUNCTIONS #####
|
||||||
check_command () {
|
|
||||||
if command -v "$1" &>/dev/null ; then
|
|
||||||
return 0
|
|
||||||
else
|
|
||||||
print_warning "command: $1 - not found!"
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
add_to_var () {
|
add_to_var () {
|
||||||
if ! echo ${!1} | grep "$2" &>/dev/null
|
if ! echo ${!1} | grep "$2" &>/dev/null
|
||||||
then export $1="${!1} $2"
|
then export $1="${!1} $2"
|
||||||
@ -449,9 +440,7 @@ EOF
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Обновляем кэш desktop файлов
|
# Обновляем кэш desktop файлов
|
||||||
if check_command update-desktop-database ; then
|
update-desktop-database "$HOME/.local/share/applications"
|
||||||
update-desktop-database "$HOME/.local/share/applications"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ $4 != "nocopy" ]] ; then
|
if [[ $4 != "nocopy" ]] ; then
|
||||||
if [[ -n $4 ]] ; then
|
if [[ -n $4 ]] ; then
|
||||||
@ -498,9 +487,8 @@ remove_desktop () {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Обновляем кэш desktop файлов
|
# Обновляем кэш desktop файлов
|
||||||
if check_command update-desktop-database ; then
|
update-desktop-database "$HOME/.local/share/applications"
|
||||||
update-desktop-database "$HOME/.local/share/applications"
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
##### INSTALLED PROGRAMS #####
|
##### INSTALLED PROGRAMS #####
|
||||||
@ -1346,9 +1334,7 @@ remove_winehelper () {
|
|||||||
done
|
done
|
||||||
|
|
||||||
# Обновление кэша desktop-файлов
|
# Обновление кэша desktop-файлов
|
||||||
if check_command update-desktop-database; then
|
update-desktop-database "$HOME/.local/share/applications"
|
||||||
update-desktop-database "$HOME/.local/share/applications"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Удаление символических ссылок
|
# Удаление символических ссылок
|
||||||
try_remove_file "$HOME/.winehelper"
|
try_remove_file "$HOME/.winehelper"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user