Skip to content

Commit

Permalink
"AM" 2.6.0 RELEASED!
Browse files Browse the repository at this point in the history
New `-b` or `backup` function that creates a backup of your selected application in /home/$USER/.am-snapshots/$PROGRAM

USAGE:

    am -b $PROGRAM
  • Loading branch information
ivan-hc authored Mar 7, 2022
1 parent 6cb0f8a commit 6110b94
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion APP-MANAGER
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ currentuser=$(who | awk '{print $1}')

rm -R -f /opt/am/options
echo "about
backup
clean
download
files
Expand Down Expand Up @@ -66,6 +67,11 @@ case "$1" in
USAGE: "am -a $PROGRAM"
DESCRIPTION: Shows the basic information, links and source of each app.
-b, backup
USAGE: "am -b $PROGRAM"
DESCRIPTION: Save the current version of a program you are interested in,
the snapshot will be stored in /home/$USER/.am-snapshots/$PROGRAM.
-c, clean
USAGE: "am -c"
DESCRIPTION: Removes all the unnecessary files and temporary folders.
Expand Down Expand Up @@ -179,6 +185,23 @@ case "$1" in
fi
done
shift;;
'-b'|'backup')
while [ -n "$1" ]
do
case $2 in
'') echo " Specify the name of a program to back up"; echo ""; exit;;
*) if test -f /opt/$2/remove; then
echo ""; read -p " Do you wish to backup the current version of $2 (y,N)?" yn
case $yn in
[Yy]* ) mkdir -p "$(xdg-user-dir USER)/.am-snapshots/$2"; cp -r /opt/$2 "$(xdg-user-dir USER)/.am-snapshots/$2/$(date)"; echo ""; echo " SAVED in $(xdg-user-dir USER)/.am-snapshots/$2"; echo "" ; exit;;
[Nn]*|* ) echo ""; echo " OPERATION ABORTED!"; exit;;
esac
else
echo ""; echo " '$2' is not a valid argument or is not installed."; echo ""; exit;
fi
esac
done
shift;;
'-c'|'clean') echo ""; echo " CLEANING OF TEMPORARY FILES AND FOLDERS IN PROGRESS" && sleep 1 && echo "" && echo " PRESS CTRL+C TO ABORT." && sleep 1 &&
echo "" && for i in {5..1}; do echo -ne " $i\r" && sleep 1; done &&
echo ""; rm -R -f /opt/am/appdb; rm -R -f /opt/am/.cache/*; rm -R -f /opt/*/tmp; echo "" && echo " DONE!"; echo "" ;;
Expand Down Expand Up @@ -445,6 +468,6 @@ case "$1" in
fi
done
shift;;
'version'|'-v'|'--version') echo "2.5.1";;
'version'|'-v'|'--version') echo "2.6.0";;
*) exec /opt/am/APP-MANAGER ;;
esac

0 comments on commit 6110b94

Please sign in to comment.