@@ -93,7 +93,7 @@ function _ending_the_installation() {
9393 $AMCLIPATH -R " $LATESTDIR " 1> /dev/null
9494 else
9595 chown -R $currentuser " $AMCACHEDIR " /about 2> /dev/null
96- for metapackage in $( echo " $ METAPACKAGES" ) ; do
96+ for metapackage in $METAPACKAGES ; do
9797 if grep -q " $metapackage " ./" $arg " 2> /dev/null; then
9898 metascript=$( ls -td " $APPSPATH " /* | head -1 | sed ' s:.*/::' )
9999 fi
@@ -106,7 +106,7 @@ function _ending_the_installation() {
106106 fi
107107 $SUDOCOMMAND rm " $AMCACHEDIR " /" $arg "
108108 _check_version
109- app_version=$( cat " $AMCACHEDIR " /version-args | grep -w " ◆ $LATESTDIR |" | sed ' s:.*| ::' )
109+ app_version=$( grep -w " ◆ $LATESTDIR |" 0< " $AMCACHEDIR " /version-args | sed ' s:.*| ::' )
110110 echo " ◆ $LATESTDIR $app_version " >> " $AMCACHEDIR " /installed
111111 fi
112112 else
@@ -217,7 +217,7 @@ function _install_arg() {
217217
218218# This function is for local installation scripts
219219function _install_local_script() {
220- path2arg=$( echo " $arg " )
220+ path2arg=" $arg "
221221 arg=$( echo " $path2arg " | sed ' s:.*/::' )
222222 mkdir -p " $AMCACHEDIR " /tmp && rm -f " $AMCACHEDIR " /tmp/* &&
223223 cp " $path2arg " " $AMCACHEDIR " /tmp/" $arg " &&
@@ -336,6 +336,7 @@ while [ -n "$1" ]; do
336336 echo " ____________________________________________________________________________"
337337 ;;
338338 * )
339+ cd " $REALDIR " || return
339340 # If the "tmp" directory is not removed, the installation failed, so remove the app
340341 if test -d " $APPSPATH " /" $arg " /tmp; then
341342 $SUDOCOMMAND " $APPSPATH " /" $arg " /remove 2> /dev/null
@@ -344,8 +345,12 @@ while [ -n "$1" ]; do
344345 if test -f " $APPSPATH " /" $arg " /remove; then
345346 echo " ◆ \" $arg \" is already installed!" | tr ' [:lower:]' ' [:upper:]'
346347 else
347- if test -f " $arg " 2> /dev/null; then
348- _install_local_script
348+ if echo " $arg " | grep -q " /" ; then
349+ if test -f " $arg " 2> /dev/null; then
350+ _install_local_script
351+ else
352+ echo " 💀 ERROR: the file \" $arg \" does NOT exist"
353+ fi
349354 elif test -f " $AMPATH /neodb" ; then
350355 _install_from_third_party_repo
351356 elif curl --output /dev/null --silent --head --fail " $APPSDB " /" $arg " 1> /dev/null; then
0 commit comments