From 60eb561c341a0f868ca8cbc275993d099dacafa7 Mon Sep 17 00:00:00 2001 From: lifehackerhansol Date: Fri, 16 Sep 2022 21:06:28 -0700 Subject: [PATCH] generator: explicitly fail if ROM is detected to be on system root - 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. --- generator/generator.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/generator/generator.py b/generator/generator.py index 58ca317..e6bcf6d 100644 --- a/generator/generator.py +++ b/generator/generator.py @@ -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':