Skip to content

Commit 7baeabd

Browse files
author
Henrik Nortamo
committed
Only show env hint if command is available
1 parent 91f4dcf commit 7baeabd

File tree

1 file changed

+21
-13
lines changed

1 file changed

+21
-13
lines changed

frontends/containerize

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -124,19 +124,27 @@ fi
124124
$M_SCRIPT_DIR/../post.sh || { print_err "Failed to move to install dir"; false ; }
125125
test -f "$_usr_yaml" && rm "$_usr_yaml"
126126
end=`date +%s`
127-
_env_root=$(realpath $(dirname $_inst_path))
128-
_env_name=$CW_INSTALLATION_PREFIX
129-
IFS=':' read -r -a _paths <<< "${TYKKY_PATH:-$HOME/.tykky}"
130-
for _path in "${_paths[@]}"; do
131-
if [ "$_env_root" = "$(realpath $_path)" ]; then
132-
_env_name=$(basename $CW_INSTALLATION_PREFIX)
133-
break
134-
fi
135-
done
136-
print_info "Done, duration: $((end-start))s" 1
137-
print_info "Environment has been installed to $CW_INSTALLATION_PREFIX
127+
128+
129+
if command -v tykky &>/dev/null ; then
130+
_env_root=$(realpath $(dirname $_inst_path))
131+
_env_name=$CW_INSTALLATION_PREFIX
132+
IFS=':' read -r -a _paths <<< "${TYKKY_PATH:-$HOME/.tykky}"
133+
for _path in "${_paths[@]}"; do
134+
if [ "$_env_root" = "$(realpath $_path)" ]; then
135+
_env_name=$(basename $CW_INSTALLATION_PREFIX)
136+
break
137+
fi
138+
done
139+
info_msg="Environment has been installed to $CW_INSTALLATION_PREFIX
138140
\tTo use, activate with:
139141
\ttykky activate $_env_name
140142
\tAlternatively, add the bin folder to your path e.g:
141-
\texport PATH=\"$_inst_path/bin:\$PATH\"" 1
142-
143+
\texport PATH=\"$_inst_path/bin:\$PATH\""
144+
else
145+
info_msg="Program has been installed to $CW_INSTALLATION_PREFIX
146+
\tTo use add the bin folder to your path e.g:
147+
\texport PATH=\"$_inst_path/bin:\$PATH\""
148+
fi
149+
print_info "Done, duration: $((end-start))s" 1
150+
print_info "$info_msg" 1

0 commit comments

Comments
 (0)