Skip to content

Commit

Permalink
add quick fix for linux user home path
Browse files Browse the repository at this point in the history
  • Loading branch information
butaixianran committed Mar 30, 2024
1 parent 925d928 commit 8ee7e6d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions scripts/ch_lib/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion scripts/ch_lib/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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": ""}
Expand Down

0 comments on commit 8ee7e6d

Please sign in to comment.