Skip to content

Commit 1407783

Browse files
author
meihuisu
committed
add check on global env setting for default install dir
1 parent b34222b commit 1407783

1 file changed

Lines changed: 15 additions & 11 deletions

File tree

ucvm_setup.py

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -782,17 +782,21 @@ def _addPROJ_LIB_python() :
782782
if skip_ask_path == False :
783783
print("Where would you like UCVM to be installed?")
784784

785-
try:
786-
if ucvmpath[0] == "$":
787-
# We want to expand that.
788-
ucvmpath = os.environ(ucvmpath[1:])
789-
except Exception:
790-
# Use default path.
791-
ucvmpath = os.path.expanduser("~")
792-
793-
# Append the version info to the path.
794-
ucvmpath = ucvmpath.rstrip("/") + "/ucvm-" + VERSION
795-
785+
my_ucvmpath=getSpecialEnvSetting('UCVM_INSTALL_PATH')
786+
787+
if(my_ucvmpath != None):
788+
ucvmpath=my_ucvmpath
789+
else:
790+
try:
791+
if ucvmpath[0] == "$":
792+
# We want to expand that.
793+
ucvmpath = os.environ(ucvmpath[1:])
794+
except Exception:
795+
# Use default path.
796+
ucvmpath = os.path.expanduser("~")
797+
798+
ucvmpath = ucvmpath.rstrip("/") + "/ucvm-" + VERSION
799+
796800
print("(Default: " + ucvmpath + ")")
797801
if sys.version_info.major >= (3) :
798802
enteredpath = input("Enter path or blank to use the default path: ")

0 commit comments

Comments
 (0)