Skip to content

Commit 91adc65

Browse files
committed
Add --noupdaterc switch to install.sh to avoid appending to *rc file. This is especially useful for package management.
1 parent 136359a commit 91adc65

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

install.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ $(printf "$zparseoptscmd") \
2727
p:=prefix_arg_array \
2828
-prefix:=prefix_arg_array \
2929
-zcompdir:=zcompdir_arg_array \
30+
-noupdaterc=noupdaterc_arg_array \
3031
h=help_arg_array \
3132
-help=help_arg_array \
3233
|| return
@@ -43,6 +44,7 @@ global_arg="$global_arg_array[-1]"
4344
prefix_arg="$prefix_arg_array[-1]"
4445
help_arg="$help_arg_array[-1]"
4546
zcompdir_arg="$zcompdir_arg_array[-1]"
47+
noupdaterc_arg="$noupdaterc_arg_array[-1]"
4648
machine="$(uname -s)"
4749

4850
function printhelp {
@@ -82,6 +84,12 @@ Options:
8284
system, check what is the best place to add to fpath
8385
(mostly in your .zshrc before invoking plugin manager)
8486
87+
--noupdaterc By default arttime installer would append a line
88+
at the end of user's ~/.zshrc or ~/.bashrc
89+
if the effective installation path is not on $PATH
90+
Providing this switch disables that, which is
91+
especially valuable for package managers
92+
8593
-h --help Print this help string for arttime installer, and exit
8694
EOF
8795
echo "$VAR"
@@ -294,7 +302,9 @@ else
294302
else
295303
profile=''
296304
fi
297-
if [[ ! -z $profile ]]; then
305+
if [[ $noupdaterc_arg != "" ]]; then
306+
echo "Installation complete! Type 'arttime' and press Enter to start arttime.\nIf arttime command is not found, try one of following:\n 1) source your *rc file or restart terminal,\n 2) add install directory to PATH in your *rc file and try 1) again."
307+
elif [[ $profile != "" ]]; then
298308
echo "\n# Following line was automatically added by arttime installer" >>$HOME/$profile
299309
echo 'export PATH='"$bindir"':$PATH' >>$HOME/$profile
300310
echo 'Note: Added export PATH='"$bindir"':$PATH to ~/'"$profile"

0 commit comments

Comments
 (0)