mirror of
https://github.com/moraroy/NonSteamLaunchers-On-Steam-Deck.git
synced 2024-12-21 23:31:52 +01:00
~attempted fix using shutil insteaad in python code
~removed chmod +x
This commit is contained in:
parent
f96f9b8a52
commit
292c57b7dd
@ -2,11 +2,6 @@
|
|||||||
|
|
||||||
# shellcheck disable=SC2155
|
# shellcheck disable=SC2155
|
||||||
|
|
||||||
# TODO: this is silly -- if the script is being executed, doesn't need to mark itself as executable
|
|
||||||
# * better to set permissions at a repo-level
|
|
||||||
# * then an end user would have to explicitly call `chmod -x` to walk it back
|
|
||||||
chmod +x "$0"
|
|
||||||
|
|
||||||
set -x # activate debugging (execution shown)
|
set -x # activate debugging (execution shown)
|
||||||
set -o pipefail # capture error from pipes
|
set -o pipefail # capture error from pipes
|
||||||
# set -eu # exit immediately, undefined vars are errors
|
# set -eu # exit immediately, undefined vars are errors
|
||||||
@ -3132,6 +3127,12 @@ if os.path.exists(os.path.join(compatdata_dir, 'NonSteamLaunchers')):
|
|||||||
# Define the new path of the NonSteamLaunchers folder
|
# Define the new path of the NonSteamLaunchers folder
|
||||||
new_path = os.path.join(compatdata_dir, str(first_app_id))
|
new_path = os.path.join(compatdata_dir, str(first_app_id))
|
||||||
|
|
||||||
|
# Check if the NonSteamLaunchers directory is empty
|
||||||
|
if os.listdir(current_path):
|
||||||
|
# The directory is not empty, so move its contents to the new location
|
||||||
|
for filename in os.listdir(current_path):
|
||||||
|
shutil.move(os.path.join(current_path, filename), new_path)
|
||||||
|
|
||||||
# Rename the NonSteamLaunchers folder
|
# Rename the NonSteamLaunchers folder
|
||||||
os.rename(current_path, new_path)
|
os.rename(current_path, new_path)
|
||||||
|
|
||||||
@ -3139,7 +3140,7 @@ if os.path.exists(os.path.join(compatdata_dir, 'NonSteamLaunchers')):
|
|||||||
symlink_path = os.path.join(compatdata_dir, 'NonSteamLaunchers')
|
symlink_path = os.path.join(compatdata_dir, 'NonSteamLaunchers')
|
||||||
|
|
||||||
# Create a symbolic link to the renamed NonSteamLaunchers folder
|
# Create a symbolic link to the renamed NonSteamLaunchers folder
|
||||||
os.symlink(new_path, symlink_path)"
|
os.symlink(new_path, symlink_path)
|
||||||
|
|
||||||
# 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
|
# 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
|
# Delete NonSteamLaunchersInstallation subfolder in Downloads folder
|
||||||
|
Loading…
Reference in New Issue
Block a user