Skip to content

Commit

Permalink
Update NSLGameScanner.py
Browse files Browse the repository at this point in the history
  • Loading branch information
moraroy committed Jun 22, 2024
1 parent 548c4e4 commit 582ce6e
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions NSLGameScanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,21 +554,25 @@ def create_new_entry(shortcutdirectory, appname, launchoptions, startingdir):
# Get the app ID for this launcher from the app_id_to_name dictionary
appid = app_ids.get(launcher_name)

# Define the new path of the folder
new_path = os.path.join(compatdata_dir, str(appid))

# Check if the new path already exists
if os.path.exists(new_path):
print(f'{new_path} already exists. Skipping renaming.')
else:
# Rename the folder
os.rename(current_path, new_path)
# If appid is not None, proceed with renaming and symlink creation
if appid is not None:
# Define the new path of the folder
new_path = os.path.join(compatdata_dir, str(appid))

# Check if the new path already exists
if os.path.exists(new_path):
print(f'{new_path} already exists. Skipping renaming.')
else:
# Rename the folder
os.rename(current_path, new_path)

# Define the path of the symbolic link
symlink_path = os.path.join(compatdata_dir, folder)
# Define the path of the symbolic link
symlink_path = os.path.join(compatdata_dir, folder)

# Create a symbolic link to the renamed folder
os.symlink(new_path, symlink_path)
# Create a symbolic link to the renamed folder
os.symlink(new_path, symlink_path)
else:
print(f'App ID for {launcher_name} is not available yet.')
else:
print(f'{launcher_name}: {folder} does not exist')

Expand Down

0 comments on commit 582ce6e

Please sign in to comment.