Skip to content

Commit

Permalink
Find correct path of global.json even with symlinks
Browse files Browse the repository at this point in the history
  • Loading branch information
niemasd authored Mar 10, 2024
1 parent 7052691 commit 4bb0604
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions favites_lite.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@

# general imports and load global.json
from os import makedirs, remove
from os.path import abspath, expanduser, isdir, isfile
from os.path import abspath, expanduser, isdir, isfile, realpath
from shutil import rmtree
from sys import argv, stderr
from time import time
import json
import random
GLOBAL_JSON_PATH = "%s/global.json" % '/'.join(abspath(expanduser(argv[0])).split('/')[:-1])
GLOBAL_JSON_PATH = "%s/global.json" % '/'.join(abspath(realpath(expanduser(__file__))).split('/')[:-1])
GLOBAL = json.loads(open(GLOBAL_JSON_PATH).read())

# external imports
Expand Down

0 comments on commit 4bb0604

Please sign in to comment.