andrebrait / 1g1r-romset-generator

A small utility that uses No-Intro DATs to generate 1G1R ROM sets
GNU General Public License v3.0
213 stars 20 forks source link

Add option to use symlinks #35

Closed gvbr closed 2 years ago

gvbr commented 2 years ago

Added the option to use symlinks when generating sets instead of copying

Using symlinks is neat because you can then create one or multiple different sets without ever needing to make more than one copy of the original ROM

Did a quick test on Linux and Windows 10, and according to the python docs it looks like creating symlinks on Windows 10 requires either administrative privileges or Developer Mode enabled

andrebrait commented 2 years ago

Mever thought of that one. Should work on macOS too, given it's UNIX.

Gonna review this and test before making a release.

Thanks a lot for the contribution!

gvbr commented 2 years ago

Did another test, looks like I get “file already exists” errors when also using --no-scan. It looks like only the output folder itself gets used in this case?

I added a small check to use the entire output filename when using symlinks, although I’m not sure if this an ideal solution

gvbr commented 2 years ago

Also it just occurred to me that it may be better to be able to use relative symlinks over absolute in some cases, like if you were going to set everything up for a separate SBC or something

I’ll see if I can add that option maybe tomorrow or so

gvbr commented 2 years ago

I added the option for --relative symlinks, and it seems to work on both Linux and Windows 10. That said as the python docs mention, on Windows you'll get an error when trying to make a relative path across different drives

Also for clarity I renamed the symlink option simply to --symlink. Let me know if you have any thoughts/concerns

andrebrait commented 2 years ago

Looks great! I'm gonna test it on my side and create a release with it. Thanks for the contribution!