mirror of
https://github.com/moraroy/NonSteamLaunchers-On-Steam-Deck.git
synced 2024-12-21 23:31:52 +01:00
Moved downlaoding of Modules from .py into the .sh
~also removed Origin from lists
This commit is contained in:
parent
f07422c182
commit
8e5934e1ef
@ -30,40 +30,8 @@ epic_games_launcher = os.environ.get('epic_games_launcher', '')
|
|||||||
ubisoft_connect_launcher = os.environ.get('ubisoft_connect_launcher', '')
|
ubisoft_connect_launcher = os.environ.get('ubisoft_connect_launcher', '')
|
||||||
ea_app_launcher = os.environ.get('ea_app_launcher', '')
|
ea_app_launcher = os.environ.get('ea_app_launcher', '')
|
||||||
|
|
||||||
# Create Folders
|
|
||||||
# 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']
|
|
||||||
|
|
||||||
# Get the directory of the Python script
|
|
||||||
current_dir = os.path.dirname(os.path.realpath(__file__))
|
|
||||||
|
|
||||||
# Define the parent folder
|
# Define the parent folder
|
||||||
parent_folder = os.path.join(current_dir, 'Modules')
|
parent_folder = ".config/systemd/user/Modules"
|
||||||
os.makedirs(parent_folder, exist_ok=True)
|
|
||||||
|
|
||||||
# Check if the folders already exist
|
|
||||||
folders_exist = all(os.path.exists(os.path.join(current_dir, parent_folder, folder)) for folder in folders_to_clone)
|
|
||||||
|
|
||||||
if not folders_exist:
|
|
||||||
# Download the repository as a zip file
|
|
||||||
zip_file_path = os.path.join(current_dir, 'repo.zip')
|
|
||||||
urlretrieve(repo_url, zip_file_path)
|
|
||||||
|
|
||||||
# Extract the zip file
|
|
||||||
with zipfile.ZipFile(zip_file_path, 'r') as zip_ref:
|
|
||||||
zip_ref.extractall(current_dir)
|
|
||||||
|
|
||||||
# Move the folders to the current directory and delete the unnecessary files
|
|
||||||
for folder in folders_to_clone:
|
|
||||||
destination_path = os.path.join(current_dir, parent_folder, folder)
|
|
||||||
source_path = os.path.join(current_dir, 'NonSteamLaunchers-On-Steam-Deck-main', 'Modules', folder)
|
|
||||||
if not os.path.exists(destination_path):
|
|
||||||
shutil.move(source_path, destination_path)
|
|
||||||
|
|
||||||
# Delete the downloaded zip file and the extracted repository folder
|
|
||||||
os.remove(zip_file_path)
|
|
||||||
shutil.rmtree(os.path.join(current_dir, 'NonSteamLaunchers-On-Steam-Deck-main'))
|
|
||||||
|
|
||||||
# Now that the requests module has been downloaded, you can import it
|
# Now that the requests module has been downloaded, you can import it
|
||||||
sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)), parent_folder))
|
sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)), parent_folder))
|
||||||
@ -283,7 +251,6 @@ game_launchers = {
|
|||||||
'Epic Games',
|
'Epic Games',
|
||||||
'Gog Galaxy',
|
'Gog Galaxy',
|
||||||
'Ubisoft Connect',
|
'Ubisoft Connect',
|
||||||
'Origin',
|
|
||||||
'Battle.net',
|
'Battle.net',
|
||||||
'EA App',
|
'EA App',
|
||||||
'Amazon Games',
|
'Amazon Games',
|
||||||
@ -313,7 +280,6 @@ name_mapping = {
|
|||||||
'Epic Games': 'Epic Games Store (Program)',
|
'Epic Games': 'Epic Games Store (Program)',
|
||||||
'Gog Galaxy': 'GOG Galaxy (Program)',
|
'Gog Galaxy': 'GOG Galaxy (Program)',
|
||||||
'Ubisoft Connect': 'Ubisoft Connect (Program)',
|
'Ubisoft Connect': 'Ubisoft Connect (Program)',
|
||||||
'Origin': 'Origin (Program)',
|
|
||||||
'Battle.net': 'Battle.net (Program)',
|
'Battle.net': 'Battle.net (Program)',
|
||||||
'Legacy Games': 'Legacy Games (Program)',
|
'Legacy Games': 'Legacy Games (Program)',
|
||||||
'Humble Bundle': 'Humble Bundle (Website)',
|
'Humble Bundle': 'Humble Bundle (Website)',
|
||||||
|
Loading…
Reference in New Issue
Block a user