Skip to content

Commit

Permalink
Add new option "-ia", for AppImages only...
Browse files Browse the repository at this point in the history
...same as "-i"/"install", but to run only installation scripts for AppImages
  • Loading branch information
ivan-hc authored Aug 29, 2024
1 parent b42a1ae commit f86e112
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 6 deletions.
19 changes: 14 additions & 5 deletions APP-MANAGER
Original file line number Diff line number Diff line change
Expand Up @@ -287,10 +287,10 @@ _am_newrepo_check "$@"

# COMPLETION LIST
available_options="about add apikey backup clean config disable downgrade download enable extra files \
home info install launcher list lock neodb newrepo nolibfuse off on overwrite purge query \
remove sandbox select sync template test unlock update --appimages --apps --byname --config \
--convert --debug --devmode-disable --devmode-enable --force-latest --home --launcher --less \
--pkg --rollback --disable-sandbox --sandbox --system --user"
home info install install-appimage launcher list lock neodb newrepo nolibfuse off on overwrite \
purge query remove sandbox select sync template test unlock update --appimages --apps --byname \
--config --convert --debug --devmode-disable --devmode-enable --force-latest --home --launcher \
--less --pkg --rollback --disable-sandbox --sandbox --system --user"

function _completion_lists() {
# Remove existing lists and download new ones
Expand Down Expand Up @@ -724,6 +724,14 @@ Description: Install one or more programs or libraries from the list. With the \
\"--debug\" option you can see log messages to debug the script. For more \
details on \"--force-latest\", see the dedicated option, below.
${Gold}install-appimage, -ia\033[0m
${LightBlue}$AMCLI -ia {PROGRAM}
${LightBlue}$AMCLI -ia --debug {PROGRAM}
${LightBlue}$AMCLI -ia --force-latest {PROGRAM}\033[0m
Description: Same as \"install\" (see above) but for AppImages only.
${Gold}lock\033[0m
${LightBlue}$AMCLI lock {PROGRAM}\033[0m
Expand Down Expand Up @@ -1103,7 +1111,8 @@ case "$1" in
;;
'download'|'-d'|\
'extra'|'-e'|\
'install'|'-i')
'install'|'-i'|\
'install-appimage'|'-ia')
MODULE="install.am"
_online_check
_if_appman_mode_enabled
Expand Down
30 changes: 29 additions & 1 deletion modules/install.am
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ for metapackage in $METAPACKAGES; do
done
}


######################
# INSTALLATION PROCESS
######################
Expand Down Expand Up @@ -367,6 +366,35 @@ case "$1" in
fi
;;

'-ia'|'install-appimage')
if [ "$2" = "--debug" ]; then
echo "--debug " > "$AMCACHEDIR"/install-args
ARGS="$(echo "$@" | cut -f3- -d ' ' | tr ' ' '\n' | grep -v -- "--")"
elif [ "$2" = "--force-latest" ]; then
echo "--force-latest " > "$AMCACHEDIR"/install-args
ARGS="$(echo "$@" | cut -f3- -d ' ' | tr ' ' '\n' | grep -v -- "--")"
else
rm -f "$AMCACHEDIR"/install-args
ARGS="$(echo "$@" | cut -f2- -d ' ' | tr ' ' '\n' | grep -v -- "--")"
fi
for arg in $ARGS; do
curl -Ls "$AMREPO/programs/$arch-appimages" > "$AMCACHEDIR/$arch-appimages"
if grep -q "^◆ $arg : " "$AMCACHEDIR/$arch-appimages"; then
echo "$arg" >> "$AMCACHEDIR"/install-args
else
arg="$arg-appimage"
if ! grep -q "^◆ $arg : " "$AMCACHEDIR/$arch-appimages"; then
echo "\"$(echo "$arg" | sed 's/-appimage//g')\" is not an Appimage"
else
echo "$arg" >> "$AMCACHEDIR"/install-args
fi
fi
done
APPIMAGES_ARGS=$(cat "$AMCACHEDIR"/install-args | sed 's/\n/ /g')
"$AMCLIPATH" -i "$APPIMAGES_ARGS"
exit 1
;;

'-e'|'extra')
if [ -z "$2" ] || [ -z "$3" ]; then
echo " USAGE: $AMCLI $1 user/project [ARGUMENT]"
Expand Down

0 comments on commit f86e112

Please sign in to comment.