Put everything through shellcheck

This commit is contained in:
Phantop 2022-01-14 13:41:46 -05:00
parent e3bbef6c98
commit c043fb00ef
8 changed files with 20 additions and 20 deletions

6
AppRun
View file

@ -1,4 +1,4 @@
#!/bin/sh #!/bin/sh
HERE=$(dirname $(readlink -f "${0}")) HERE=$(dirname "$(readlink -f "${0}")")
export LD_LIBRARY_PATH="${HERE}":$PATH export LD_LIBRARY_PATH="${HERE}":"$PATH"
"${HERE}"/$APPDWARF_CMD "$@" "${HERE}"/"$APPDWARF_CMD" "$@"

View file

@ -2,8 +2,8 @@
set -eo pipefail set -eo pipefail
IFS=$'\n\t' IFS=$'\n\t'
VER=2 VER=2
HERE=$(dirname $(readlink -f "${0}")) HERE=$(dirname "$(readlink -f "${0}")")
source $HERE/headers source "$HERE/headers"
usage(){ usage(){
echo "Usage: $(basename "$0") [option] [FILE/FOLDER/URL]" echo "Usage: $(basename "$0") [option] [FILE/FOLDER/URL]"
@ -14,12 +14,12 @@ usage(){
echo " -s, --separate Use old, separated header format" echo " -s, --separate Use old, separated header format"
echo " -u, --url Fetch AppImage from URL and convert to appdwarf" echo " -u, --url Fetch AppImage from URL and convert to appdwarf"
echo " -h, --help Print this help text" echo " -h, --help iPrint this help text"
echo " -v, --version Print the appdwarf version" echo " -v, --version Print the appdwarf version"
} }
dwarf() { dwarf() {
mkdwarfs -i "$1" -o "$(realpath "$1").sh" -B$back "${@:2}" --header $HEAD mkdwarfs -i "$1" -o "$(realpath "$1").sh" -B"$back" "${@:2}" --header "$HEAD"
chmod +x "$(realpath "$1").sh" chmod +x "$(realpath "$1").sh"
} }
@ -58,7 +58,7 @@ do
exit 0 exit 0
;; ;;
--folder | -f) --folder | -f)
header_folder $(realpath $2) header_folder "$(realpath "$2")"
shift 2 shift 2
;; ;;
--lookback | -b) --lookback | -b)

View file

@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
LINK1=https://raw.githubusercontent.com/AppImage/appimage.github.io/master/apps/$1.md LINK1=https://raw.githubusercontent.com/AppImage/appimage.github.io/master/apps/$1.md
LINK2="$(curl $LINK1 | grep -o https.\*releases | sed 's|github.com|api.github.com/repos|')" LINK2="$(curl "$LINK1" | grep -o https.\*releases | sed 's|github.com|api.github.com/repos|')"
LINK3="$(curl $LINK2 | grep -v arm64 | grep -om1 https.\*AppImage)" LINK3="$(curl "$LINK2" | grep -v arm64 | grep -om1 https.\*AppImage)"
appdwarf -u $LINK3 appdwarf -u "$LINK3"

View file

@ -1,9 +1,9 @@
#!/bin/bash #!/bin/bash
PATH=$(dirname $(readlink -f "${0}"))/..:$PATH PATH=$(dirname "$(readlink -f "${0}")")/..:$PATH
DIR=/tmp/dwarf-portable-executable DIR=/tmp/dwarf-portable-executable
mkdir -p $DIR mkdir -p $DIR
LINK=$(curl -sL https://golang.org/dl | grep -om1 dl/go.\*linux-amd64.tar.gz) LINK=$(curl -sL https://golang.org/dl | grep -om1 dl/go.\*linux-amd64.tar.gz)
curl -L https://golang.org/$LINK | tar xz -C$DIR curl -L https://golang.org/"$LINK" | tar xz -C$DIR
cat > $DIR/go/AppRun << 'EOF' cat > $DIR/go/AppRun << 'EOF'
#!/bin/sh #!/bin/sh

View file

@ -1,12 +1,12 @@
#!/bin/bash #!/bin/bash
PATH=$(dirname $(readlink -f "${0}"))/..:$PATH PATH=$(dirname "$(readlink -f "${0}")")/..:$PATH
DIR=/tmp/dwarf-portable-executable/java DIR=/tmp/dwarf-portable-executable/java
JRE=$DIR/jre JRE=$DIR/jre
VER=$1 VER=$1
mkdir -p $DIR mkdir -p $DIR
LINK=https://api.adoptium.net/v3/binary/latest/$1/ga/linux/x64/jdk/hotspot/normal/eclipse LINK=https://api.adoptium.net/v3/binary/latest/$1/ga/linux/x64/jdk/hotspot/normal/eclipse
curl -L $LINK | tar xz -C$DIR curl -L "$LINK" | tar xz -C$DIR
$DIR/jdk*/bin/jlink --add-modules ALL-MODULE-PATH --output $JRE --strip-debug --no-man-pages --no-header-files --compress=0 $DIR/jdk*/bin/jlink --add-modules ALL-MODULE-PATH --output $JRE --strip-debug --no-man-pages --no-header-files --compress=0
@ -21,5 +21,5 @@ chmod +x $JRE/AppRun
shift shift
appdwarf $JRE $@ appdwarf $JRE $@
mv $JRE.sh java$VER mv $JRE.sh java"$VER"
rm -rf $DIR rm -rf $DIR

View file

@ -1,10 +1,10 @@
#!/bin/bash #!/bin/bash
PATH=$(dirname $(readlink -f "${0}"))/..:$PATH PATH=$(dirname "$(readlink -f "${0}")")/..:$PATH
DIR=/tmp/dwarf-portable-executable/proton DIR=/tmp/dwarf-portable-executable/proton
mkdir -p $DIR mkdir -p $DIR
LINK="$(curl https://api.github.com/repos/GloriousEggroll/proton-ge-custom/releases | grep -om1 http.\*tar.gz)" LINK="$(curl https://api.github.com/repos/GloriousEggroll/proton-ge-custom/releases | grep -om1 http.\*tar.gz)"
curl -L $LINK | tar xz -C$DIR curl -L "$LINK" | tar xz -C$DIR
mv $DIR/Proton*/files/* $DIR mv $DIR/Proton*/files/* $DIR
rm -rf $DIR/Proton*/ rm -rf $DIR/Proton*/

View file

@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
PATH=$(dirname $(readlink -f "${0}"))/..:$PATH PATH=$(dirname "$(readlink -f "${0}")")/..:$PATH
DIR=/tmp/dwarf-portable-executable/wine DIR=/tmp/dwarf-portable-executable/wine
mkdir -p $DIR mkdir -p $DIR

View file

@ -35,7 +35,7 @@ EOF
header_folder() { header_folder() {
echo '#!/bin/sh' > $HEAD echo '#!/bin/sh' > $HEAD
echo DIR=\"$1\" >> $HEAD echo DIR=\""$1"\" >> $HEAD
cat >> $HEAD << 'EOF' cat >> $HEAD << 'EOF'
if [ ! -d "$DIR" ]; then if [ ! -d "$DIR" ]; then
mkdir "$DIR" mkdir "$DIR"