Skip to content

Commit

Permalink
generator: explicitly fail if ROM is detected to be on system root
Browse files Browse the repository at this point in the history
- Until now, this wasn't captured.
- It wasn't a big deal on Windows, but on everything else this caused
  the '/' character to be completely removed from the ROM path, which
  generated something similar to "sd:ROMsNDSMario Kart DS.nds".
- Make the program exit when it is detected not to be on the SD card,
  or if a custom path is not set.
  • Loading branch information
lifehackerhansol committed Sep 17, 2022
1 parent 2560e75 commit 60eb561
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions generator/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,9 @@ def getrompath(self, path) -> str:
break
temp = direc
root = temp
if root == "C:" or root == "/":
self.message("This ROM is not on your SD card!\nPlease use a ROM on your SD card, or set a custom path.")
exit()
path = unicodedata.normalize("NFC", os.path.abspath(path))
path = path.replace(root, "")
if os.name == 'nt':
Expand Down

0 comments on commit 60eb561

Please sign in to comment.