fixed an issue with resolving config files when smuggler.py is executed via a symbolic link

This commit is contained in:
defparam 2020-06-29 17:34:08 -07:00
parent 2d6930e1bc
commit bdf9ccf08e

7
smuggler.py Normal file → Executable file
View File

@ -131,7 +131,12 @@ class Desyncr():
return
if (self._configfile[1] != '/'):
self._configfile = os.path.dirname(os.path.abspath(__file__)) + "/configs/" + self._configfile
abspath = os.path.abspath(__file__)
if (os.path.islink(abspath)):
curpath = os.path.dirname(os.readlink(abspath))
else:
curpath = os.path.dirname(os.path.abspath(__file__))
self._configfile = curpath + "/configs/" + self._configfile
try:
f = open(self._configfile)