added check file desktop.list before grep

This commit is contained in:
Mikhail Tergoev 2025-05-26 15:59:49 +03:00
parent 717e6c0e7d
commit b4d36b15e8

View File

@ -405,7 +405,8 @@ create_desktop () {
# добавляем информацию о приложении в "$WINEPREFIX/desktop.list"
if grep -qe "^${name_desktop}=" "$WINEPREFIX/desktop.list"
if [[ -f "$WINEPREFIX/desktop.list" ]] \
&& grep -qe "^${name_desktop}=" "$WINEPREFIX/desktop.list"
then sed -i "/^$name_desktop=/d" "$WINEPREFIX/desktop.list"
fi
echo "$name_desktop=${exe_file//$WINEPREFIX/}" >> "$WINEPREFIX/desktop.list"