L0laapk3 / FactorioMaps

L0laapk3's FactorioMaps mod
https://mods.factorio.com/mod/L0laapk3_FactorioMaps
Other
119 stars 22 forks source link

Symlinks from script-output do not work in 0.17 #33

Closed L0laapk3 closed 4 years ago

L0laapk3 commented 5 years ago

If you would like this to work again, please redirect your concerns to this factorio thread:

https://forums.factorio.com/viewtopic.php?f=7&t=68499

fbartho commented 5 years ago

I was able to bypass this by rewriting how the Symlink command was written:

    def linkDir(src, dest):
        print('os.name: {}'.format(os.name))
        if os.path.exists(dest) == True:
            return

        if os.name == 'nt':
            cmd = ("MKLINK", "/J", os.path.abspath(src), os.path.abspath(dest))
        elif os.name == 'posix':
            cmd = "ln -s '{}' '{}'".format(os.path.abspath(src), os.path.abspath(dest))
        else:
            cmd = ("ln", "-s", os.path.abspath(src), os.path.abspath(dest))
        subprocess.check_call(cmd, stdout=subprocess.DEVNULL, shell=True)

Not sure why the else-block's command wasn't working.

L0laapk3 commented 5 years ago

Thats something else entirely, thats been fixed as of 548816420043ef8ecf66d983286df01d86448f5c. This issue is about a sub folder inside the script-output folder being a symlink to, for example, a different drive.

L0laapk3 commented 4 years ago

This is a workaround, not a complete solution. But since factorio devs don't seem to be changing their mind about this issue anytime soon this will have to do.