From 7429cde9f4a819e04b07c40320ee6c6313105cf4 Mon Sep 17 00:00:00 2001 From: Roy <88516395+moraroy@users.noreply.github.com> Date: Thu, 14 Mar 2024 11:21:32 -0700 Subject: [PATCH] Update NonSteamLaunchers.sh --- NonSteamLaunchers.sh | 88 ++++++++++++++++++++++---------------------- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/NonSteamLaunchers.sh b/NonSteamLaunchers.sh index 9872e87..eea40e4 100755 --- a/NonSteamLaunchers.sh +++ b/NonSteamLaunchers.sh @@ -61,52 +61,52 @@ for arg in "${args[@]}"; do elif [ "$arg" = "Chrome" ]; then installchrome=true fi + + if [ "${deckyplugin}" = false ]; then + #Download Modules + # Define the repository and the folders to clone + repo_url='https://github.com/moraroy/NonSteamLaunchers-On-Steam-Deck/archive/refs/heads/main.zip' + folders_to_clone=('requests' 'urllib3' 'steamgrid' 'vdf') + + # Define the parent folder + logged_in_home=$(eval echo ~$user) + parent_folder="${logged_in_home}/.config/systemd/user/Modules" + mkdir -p "${parent_folder}" + + # Check if the folders already exist + folders_exist=true + for folder in "${folders_to_clone[@]}"; do + if [ ! -d "${parent_folder}/${folder}" ]; then + folders_exist=false + break + fi + done + + if [ "${folders_exist}" = false ]; then + # Download the repository as a zip file + zip_file_path="${parent_folder}/repo.zip" + wget -O "${zip_file_path}" "${repo_url}" + + # Extract the zip file + unzip -d "${parent_folder}" "${zip_file_path}" + + # Move the folders to the parent directory and delete the unnecessary files + for folder in "${folders_to_clone[@]}"; do + destination_path="${parent_folder}/${folder}" + source_path="${parent_folder}/NonSteamLaunchers-On-Steam-Deck-main/Modules/${folder}" + if [ ! -d "${destination_path}" ]; then + mv "${source_path}" "${destination_path}" + fi + done + + # Delete the downloaded zip file and the extracted repository folder + rm "${zip_file_path}" + rm -r "${parent_folder}/NonSteamLaunchers-On-Steam-Deck-main" + fi + #End of Download Modules + fi done - -if [ "${deckyplugin}" = false ]; then - #Download Modules - # Define the repository and the folders to clone - repo_url='https://github.com/moraroy/NonSteamLaunchers-On-Steam-Deck/archive/refs/heads/main.zip' - folders_to_clone=('requests' 'urllib3' 'steamgrid' 'vdf') - - # Define the parent folder - logged_in_home=$(eval echo ~$user) - parent_folder="${logged_in_home}/.config/systemd/user/Modules" - mkdir -p "${parent_folder}" - - # Check if the folders already exist - folders_exist=true - for folder in "${folders_to_clone[@]}"; do - if [ ! -d "${parent_folder}/${folder}" ]; then - folders_exist=false - break - fi - done - - if [ "${folders_exist}" = false ]; then - # Download the repository as a zip file - zip_file_path="${parent_folder}/repo.zip" - wget -O "${zip_file_path}" "${repo_url}" - - # Extract the zip file - unzip -d "${parent_folder}" "${zip_file_path}" - - # Move the folders to the parent directory and delete the unnecessary files - for folder in "${folders_to_clone[@]}"; do - destination_path="${parent_folder}/${folder}" - source_path="${parent_folder}/NonSteamLaunchers-On-Steam-Deck-main/Modules/${folder}" - if [ ! -d "${destination_path}" ]; then - mv "${source_path}" "${destination_path}" - fi - done - - # Delete the downloaded zip file and the extracted repository folder - rm "${zip_file_path}" - rm -r "${parent_folder}/NonSteamLaunchers-On-Steam-Deck-main" - fi - #End of Download Modules - #Service File rough update rm -rf ${logged_in_home}/.config/systemd/user/NSLGameScanner.py