Skip to content

Commit df931da

Browse files
authored
Merge pull request #687 from ivan-hc/dev
Improve "template.am" to speed up the creation of installation scripts
2 parents 975e9e2 + 5407dd0 commit df931da

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+474
-552
lines changed

APP-MANAGER

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22

3-
AMVERSION="6.12.1"
3+
AMVERSION="6.13"
44

55
# Determine main repository and branch
66
AMREPO="https://raw.githubusercontent.com/ivan-hc/AM/main"
@@ -361,12 +361,12 @@ function _check_version_if_zsync_file_exists() {
361361
}
362362

363363
function _check_version_if_version_file_exists() {
364-
APPVERSION=$(cat $APPSPATH/$arg/version | head -1 | sed 's:.*/::' | sed "s/$arch//g" | sed "s/amd64//g" | tr '-' '\n' | tr '_' '\n' | grep -vi "appimage\|$arg\|?\|tar." | grep "[0-9]" | head -1 | sed 's/^v//g')
364+
APPVERSION=$(cat $APPSPATH/$arg/version | head -1 | sed 's:.*/::' | sed "s/$arch//g; s/amd64//g; s/x86-64//g;" | tr '-' '\n' | tr '_' '\n' | grep -vi "appimage\|$arg\|?\|tar." | grep "[0-9]" | head -1 | sed 's/^v//g')
365365
if [ -z "$APPVERSION" ]; then
366366
if grep -q "/v[0-9]*" ./$arg/version; then
367367
APPVERSION=$(cat $APPSPATH/$arg/version | tr '/' '\n' | grep "^v[0-9]" | head -1 | sed 's/^v//g')
368368
elif grep -q "download$" ./$arg/version; then
369-
APPVERSION=$(cat $APPSPATH/$arg/version | tr '/' '\n' | sed "s/$arch//g" | sed "s/amd64//g" | tr '_' '\n' | grep -vi "appimage\|$arg\|?\|tar." | grep "[0-9]" | tail -1 | sed 's/^v//g')
369+
APPVERSION=$(cat $APPSPATH/$arg/version | tr '/' '\n' | sed "s/$arch//g; s/amd64//g; s/x86-64//g;" | tr '_' '\n' | grep -vi "appimage\|$arg\|?\|tar." | grep "[0-9]" | tail -1 | sed 's/^v//g')
370370
elif grep -q "://" ./$arg/version; then
371371
APPVERSION=$(cat ./$arg/version | tr '/' '\n' | grep -Eo "([0-9]{1,}\.)+[0-9]{1,}" | head -1)
372372
elif [ "$(cat ./$arg/version | wc -w)" == 1 ]; then

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1056,7 +1056,17 @@ https://github.com/ivan-hc/AM/assets/88724353/6ae38787-e0e5-4b63-b020-c89c1e975d
10561056
#### Option Two: "Archives and other programs"
10571057
Option two is very similar to option zero. What changes is the number of questions, which allow you to customize both the application's .desktop file and the way a program should be extracted.
10581058

1059-
https://github.com/ivan-hc/AM/assets/88724353/80a08024-0282-4cc0-a2a5-a31554df973b
1059+
This script also supports extraction of *7z, *tar* and *zip files, if those archives are downloaded instead of a standalone binary.
1060+
1061+
By default, the install script does not have a launcher and icon. To create one, press "Y", otherwise, press "N" or leave it blank. This is useful if you want to load scripts or tools that can be used from the command line.
1062+
1063+
This option may be used also for AppImages, if you need to customize the launcher.
1064+
1065+
Tu add an icon, you need an URL to that, but if you don't have one, just leave blank. The script will download an icon from [portable-linux-apps.github.io](https://portable-linux-apps.github.io/) if it is hosted there, when running the installation script.
1066+
1067+
In this example, I'll use OBS Studio AppImage.
1068+
1069+
https://github.com/ivan-hc/AM/assets/88724353/ce46e2f2-c251-4520-b41f-c511d4ce6c7d
10601070

10611071
#### Option Three: "Firefox profiles"
10621072
Option 3 creates a launcher that opens Firefox in a custom profile and on a specific page, such as in a WebApp. I created this option to counterbalance the amount of Electron/Chrome-based applications (and because I'm a firm Firefox's supporter).

modules/template.am

Lines changed: 300 additions & 377 deletions
Large diffs are not rendered by default.

programs/aarch64/yazi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ SITE="sxyazi/yazi"
88

99
# CREATE DIRECTORIES AND ADD REMOVER
1010
[ -n "$APP" ] && mkdir -p "/opt/$APP/tmp" && cd "/opt/$APP/tmp" || exit 1
11-
echo "#!/bin/sh\nset -e\nrm -f /usr/local/bin/$APP\nrm -R -f /opt/$APP" > "/opt/$APP/remove"
12-
echo "rm -f /usr/local/bin/ya" >> "/opt/$APP/remove"
11+
printf "#!/bin/sh\nset -e\nrm -f /usr/local/bin/$APP\nrm -R -f /opt/$APP" > "/opt/$APP/remove"
12+
printf '\n%s' "rm -f /usr/local/bin/ya" >> "/opt/$APP/remove"
1313
chmod a+x "/opt/$APP/remove"
1414

1515
# DOWNLOAD AND PREPARE THE APP

programs/aarch64/zramen

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ SITE="atweiden/zramen"
88

99
# CREATE DIRECTORIES AND ADD REMOVER
1010
[ -n "$APP" ] && mkdir -p "/opt/$APP/tmp" && cd "/opt/$APP/tmp" || exit 1
11-
echo "#!/bin/sh\nset -e\nrm -f /usr/local/bin/$APP\nrm -R -f /opt/$APP" > "/opt/$APP/remove"
12-
#echo "rm -f /usr/share/applications/AM-$APP.desktop" >> "/opt/$APP/remove"
11+
printf "#!/bin/sh\nset -e\nrm -f /usr/local/bin/$APP\nrm -R -f /opt/$APP" > "/opt/$APP/remove"
12+
#printf '\n%s' "rm -f /usr/share/applications/AM-$APP.desktop" >> "/opt/$APP/remove"
1313
chmod a+x "/opt/$APP/remove"
1414

1515
# DOWNLOAD AND PREPARE THE APP

programs/x86_64/aisap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ SITE="mgord9518/aisap"
77

88
# CREATE DIRECTORIES AND ADD REMOVER
99
[ -n "$APP" ] && mkdir -p "/opt/$APP/tmp" "/opt/$APP/icons" && cd "/opt/$APP/tmp" || exit 1
10-
echo "#!/bin/sh\nset -e\nrm -f /usr/local/bin/$APP\nrm -R -f /opt/$APP" > "/opt/$APP/remove"
11-
echo "rm -f /usr/share/applications/AM-$APP.desktop" >> "/opt/$APP/remove"
10+
printf "#!/bin/sh\nset -e\nrm -f /usr/local/bin/$APP\nrm -R -f /opt/$APP" > "/opt/$APP/remove"
11+
printf '\n%s' "rm -f /usr/share/applications/AM-$APP.desktop" >> "/opt/$APP/remove"
1212
chmod a+x "/opt/$APP/remove"
1313

1414
# DOWNLOAD AND PREPARE THE APP, $version is also used for updates

programs/x86_64/badlion

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ SITE="https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/games/badlion-
77

88
# CREATE DIRECTORIES AND ADD REMOVER
99
[ -n "$APP" ] && mkdir -p "/opt/$APP/tmp" "/opt/$APP/icons" && cd "/opt/$APP/tmp" || exit 1
10-
echo "#!/bin/sh\nset -e\nrm -f /usr/local/bin/$APP\nrm -R -f /opt/$APP" > "/opt/$APP/remove"
11-
echo "rm -f /usr/share/applications/AM-$APP.desktop" >> "/opt/$APP/remove"
10+
printf "#!/bin/sh\nset -e\nrm -f /usr/local/bin/$APP\nrm -R -f /opt/$APP" > "/opt/$APP/remove"
11+
printf '\n%s' "rm -f /usr/share/applications/AM-$APP.desktop" >> "/opt/$APP/remove"
1212
chmod a+x "/opt/$APP/remove"
1313

1414
# DOWNLOAD AND PREPARE THE APP, $version is also used for updates

programs/x86_64/bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ SITE="sharkdp/bat"
77

88
# CREATE DIRECTORIES AND ADD REMOVER
99
[ -n "$APP" ] && mkdir -p "/opt/$APP/tmp" "/opt/$APP/icons" && cd "/opt/$APP/tmp" || exit 1
10-
echo "#!/bin/sh\nset -e\nrm -f /usr/local/bin/$APP\nrm -R -f /opt/$APP" > "/opt/$APP/remove"
10+
printf "#!/bin/sh\nset -e\nrm -f /usr/local/bin/$APP\nrm -R -f /opt/$APP" > "/opt/$APP/remove"
1111
chmod a+x "/opt/$APP/remove"
1212

1313
# DOWNLOAD AND PREPARE THE APP, $version is also used for updates

programs/x86_64/bat-extras

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ fi
3434

3535
# CREATE DIRECTORIES AND ADD REMOVER
3636
[ -n "$APP" ] && mkdir -p "/opt/$APP/tmp" "/opt/$APP/icons" && cd "/opt/$APP/tmp" || exit 1
37-
echo "#!/bin/sh\nset -e\nrm -f /usr/local/bin/batdiff\nrm -R -f /opt/$APP" > "/opt/$APP/remove"
38-
echo "rm -f /usr/local/bin/batgrep" >> "/opt/$APP/remove"
39-
echo "rm -f /usr/local/bin/batman" >> "/opt/$APP/remove"
40-
echo "rm -f /usr/local/bin/bat-modules" >> "/opt/$APP/remove"
41-
echo "rm -f /usr/local/bin/batpipe" >> "/opt/$APP/remove"
42-
echo "rm -f /usr/local/bin/batwatch" >> "/opt/$APP/remove"
43-
echo "rm -f /usr/local/bin/prettybat" >> "/opt/$APP/remove"
37+
printf "#!/bin/sh\nset -e\nrm -f /usr/local/bin/batdiff\nrm -R -f /opt/$APP" > "/opt/$APP/remove"
38+
printf '\n%s' "rm -f /usr/local/bin/batgrep" >> "/opt/$APP/remove"
39+
printf '\n%s' "rm -f /usr/local/bin/batman" >> "/opt/$APP/remove"
40+
printf '\n%s' "rm -f /usr/local/bin/bat-modules" >> "/opt/$APP/remove"
41+
printf '\n%s' "rm -f /usr/local/bin/batpipe" >> "/opt/$APP/remove"
42+
printf '\n%s' "rm -f /usr/local/bin/batwatch" >> "/opt/$APP/remove"
43+
printf '\n%s' "rm -f /usr/local/bin/prettybat" >> "/opt/$APP/remove"
4444
chmod a+x "/opt/$APP/remove"
4545

4646
# DOWNLOAD AND PREPARE THE APP, $version is also used for updates

programs/x86_64/blobdrop

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ SITE="vimpostor/blobdrop"
77

88
# CREATE DIRECTORIES AND ADD REMOVER
99
[ -n "$APP" ] && mkdir -p "/opt/$APP/tmp" "/opt/$APP/icons" && cd "/opt/$APP/tmp" || exit 1
10-
echo "#!/bin/sh\nset -e\nrm -f /usr/local/bin/$APP\nrm -R -f /opt/$APP" > "/opt/$APP/remove"
11-
echo "rm -f /usr/share/applications/AM-$APP.desktop" >> "/opt/$APP/remove"
10+
printf "#!/bin/sh\nset -e\nrm -f /usr/local/bin/$APP\nrm -R -f /opt/$APP" > "/opt/$APP/remove"
11+
printf '\n%s' "rm -f /usr/share/applications/AM-$APP.desktop" >> "/opt/$APP/remove"
1212
chmod a+x "/opt/$APP/remove"
1313

1414
# DOWNLOAD AND PREPARE THE APP, $version is also used for updates

0 commit comments

Comments
 (0)