File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -250,7 +250,8 @@ discover_taxonomy_path() {
250250 taxonomy_path=$( ilab config show 2> /dev/null | grep " taxonomy_path" | head -n 1 | cut -d ' :' -f 2 | sed ' s/^ *//;s/ *$//' | tr -d ' \r\n' )
251251 else
252252 # Always use discovered python virtual environment,
253- venv_ilab=" $DISCOVERED_PYENV_DIR /bin/ilab"
253+ venv_ilab_dir=$( [ -z " $DISCOVERED_PYENV_DIR " ] && echo " $PYENV_DIR " || echo " $DISCOVERED_PYENV_DIR " )
254+ venv_ilab=" $venv_ilab_dir /bin/ilab"
254255 taxonomy_path=$( $venv_ilab config show 2> /dev/null | grep " taxonomy_path" | head -n 1 | cut -d ' :' -f 2 | sed ' s/^ *//;s/ *$//' | tr -d ' \r\n' )
255256 fi
256257 else
@@ -286,6 +287,19 @@ normalize_taxonomy_path() {
286287 fi
287288}
288289
290+ normalize_pyvenv_dir_path () {
291+ echo -e " normalize_pyvenv_dir_path called- $PYENV_DIR "
292+
293+ if [[ " $PYENV_DIR " != /* ]]; then
294+ if ! command -v realpath & > /dev/null; then
295+ PYENV_DIR=$( realpath " $PYENV_DIR " 2> /dev/null)
296+ else
297+ PYENV_DIR=" $( cd " $( dirname " $PYENV_DIR " ) " && pwd) /$( basename " $PYENV_DIR " ) "
298+ fi
299+ echo -e " ${blue} Python virtual environment path normalized to absolute path $PYENV_DIR ${reset} \n"
300+ fi
301+ }
302+
289303# Parse input arguments
290304if [[ $# -lt 1 ]]; then
291305 usage
@@ -328,6 +342,7 @@ if [[ "$COMMAND" == "install" ]]; then
328342 ;;
329343 --python-venv-dir)
330344 PYENV_DIR=$( echo " $2 " | sed ' s/^ *//;s/ *$//' )
345+ normalize_pyvenv_dir_path
331346 shift 2
332347 ;;
333348 --deploy)
You can’t perform that action at this time.
0 commit comments