mirror of
https://github.com/moraroy/NonSteamLaunchers-On-Steam-Deck.git
synced 2024-12-21 15:21:52 +01:00
Update NSLGameScanner.py
This commit is contained in:
parent
c630a7664c
commit
01e7d8278d
@ -591,6 +591,7 @@ folder_names = {
|
|||||||
'VK Play': 'VKPlayLauncher',
|
'VK Play': 'VKPlayLauncher',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Iterate over each launcher in the folder_names dictionary
|
# Iterate over each launcher in the folder_names dictionary
|
||||||
for launcher_name, folder in folder_names.items():
|
for launcher_name, folder in folder_names.items():
|
||||||
# Define the current path of the folder
|
# Define the current path of the folder
|
||||||
@ -612,8 +613,13 @@ for launcher_name, folder in folder_names.items():
|
|||||||
|
|
||||||
# Check if the new path already exists
|
# Check if the new path already exists
|
||||||
if os.path.exists(new_path):
|
if os.path.exists(new_path):
|
||||||
print(f'{new_path} already exists. Skipping renaming and symlinking.')
|
# Check if the directory is empty
|
||||||
else:
|
if not os.listdir(new_path):
|
||||||
|
print(f'{new_path} is empty. Deleting directory.')
|
||||||
|
os.rmdir(new_path)
|
||||||
|
else:
|
||||||
|
print(f'{new_path} already exists and is not empty. Skipping renaming and symlinking.')
|
||||||
|
continue # skip to the next iteration
|
||||||
# Rename the folder
|
# Rename the folder
|
||||||
os.rename(current_path, new_path)
|
os.rename(current_path, new_path)
|
||||||
print(f"Renamed {current_path} to {new_path}")
|
print(f"Renamed {current_path} to {new_path}")
|
||||||
|
Loading…
Reference in New Issue
Block a user