mirror of
https://github.com/moraroy/NonSteamLaunchers-On-Steam-Deck.git
synced 2026-06-13 04:04:59 +03:00
Refactor NSL_SCAN_STATE check in NonSteamLaunchers.sh
Refactor NSL_SCAN_STATE check to use a variable for file path and add confirmation message.
This commit is contained in:
@@ -4350,9 +4350,12 @@ echo "export compat_tool_name=$compat_tool_name" >> ${logged_in_home}/.config/sy
|
||||
echo "export python_version=$python_version" >> ${logged_in_home}/.config/systemd/user/env_vars
|
||||
echo "export chromedirectory=$chromedirectory" >> ${logged_in_home}/.config/systemd/user/env_vars
|
||||
echo "export chrome_startdir=$chrome_startdir" >> ${logged_in_home}/.config/systemd/user/env_vars
|
||||
grep -q '^NSL_SCAN_STATE=' "${logged_in_home}/.config/systemd/user/env_vars" || \
|
||||
echo "NSL_SCAN_STATE=ON" >> "${logged_in_home}/.config/systemd/user/env_vars"
|
||||
|
||||
file="${logged_in_home}/.config/systemd/user/env_vars"
|
||||
if ! grep -q "^NSL_SCAN_STATE=" "$file"; then
|
||||
echo "NSL_SCAN_STATE=ON" >> "$file"
|
||||
echo "NSL_SCAN_STATE added as ON"
|
||||
fi
|
||||
# TODO: might be better to relocate temp files to `/tmp` or even use `mktemp -d` since `rm -rf` is potentially dangerous without the `-i` flag
|
||||
|
||||
# Delete NonSteamLaunchersInstallation subfolder in Downloads folder
|
||||
|
||||
Reference in New Issue
Block a user