diff --git a/scripts/ch_lib/model.py b/scripts/ch_lib/model.py index 15cd3c47..22b86722 100644 --- a/scripts/ch_lib/model.py +++ b/scripts/ch_lib/model.py @@ -8,6 +8,18 @@ # this is the default root path root_path = os.getcwd() +util.printD(f"Root Path is: {root_path}") + +# if path is start with "~/" means root path is under linux's user home +# so need to use os.path.expanduser("~") to get the real path +if root_path.startswith("~/"): + user_home = os.path.expanduser("~") + util.printD(f"Root Path is under User Home: {user_home}") + root_path = os.path.join(user_home, root_path[2:]) + util.printD(f"Expanded Root Path is: {root_path}") + + + # if command line arguement is used to change model folder, # then model folder is in absolute path, not based on this root path anymore. diff --git a/scripts/ch_lib/util.py b/scripts/ch_lib/util.py index 0a34f9c4..71b32960 100644 --- a/scripts/ch_lib/util.py +++ b/scripts/ch_lib/util.py @@ -6,7 +6,7 @@ import shutil -version = "1.10.2" +version = "1.10.3" def_headers = {'User-Agent': 'Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148', "Authorization": ""}