mirror of
https://github.com/Phantop/appdwarf.git
synced 2025-01-09 13:47:08 +00:00
Improve default options
This commit is contained in:
parent
6c9813cd46
commit
5eca8a2ad8
4
appdwarf
4
appdwarf
|
@ -11,10 +11,10 @@ usage(){
|
||||||
}
|
}
|
||||||
|
|
||||||
dwarf() {
|
dwarf() {
|
||||||
mkdwarfs -i "$1" -o "$(basename "$1").sh" "${@:2}" --header <(cat << 'EOF'
|
mkdwarfs -i "$1" -o "$(basename "$1").sh" -B5 "${@:2}" --header <(cat << 'EOF'
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
DIR="$(mktemp -td dwarf_$(basename "$0")XXXXX)"
|
DIR="$(mktemp -td dwarf_$(basename "$0")XXXXX)"
|
||||||
dwarfs -o offset=auto "$0" "$DIR" 2> /dev/null
|
dwarfs -o offset=auto -o tidy_strategy=swap "$0" "$DIR" 2> /dev/null
|
||||||
"$DIR/AppRun" "$@"
|
"$DIR/AppRun" "$@"
|
||||||
fusermount -uz "$DIR" 2> /dev/null
|
fusermount -uz "$DIR" 2> /dev/null
|
||||||
rmdir "$DIR" 2> /dev/null
|
rmdir "$DIR" 2> /dev/null
|
||||||
|
|
8
mkjava
8
mkjava
|
@ -2,8 +2,9 @@
|
||||||
PATH=$(dirname $(readlink -f "${0}")):$PATH
|
PATH=$(dirname $(readlink -f "${0}")):$PATH
|
||||||
DIR=/tmp/dwarf-portable-executable/java
|
DIR=/tmp/dwarf-portable-executable/java
|
||||||
mkdir -p $DIR
|
mkdir -p $DIR
|
||||||
curl -L https://api.adoptopenjdk.net/v3/binary/latest/11/ga/linux/x64/jre/openj9/normal/adoptopenjdk | tar xz -C$DIR
|
curl -L https://api.adoptopenjdk.net/v3/binary/latest/$1/ga/linux/x64/jre/openj9/normal/adoptopenjdk | tar xz -C$DIR
|
||||||
JDK=$(echo $DIR/jdk*)
|
JDK=$(echo $DIR/jdk*)
|
||||||
|
ver=$1
|
||||||
|
|
||||||
cat > $JDK/AppRun << 'EOF'
|
cat > $JDK/AppRun << 'EOF'
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
@ -15,6 +16,7 @@ EOF
|
||||||
|
|
||||||
chmod +x $JDK/AppRun
|
chmod +x $JDK/AppRun
|
||||||
|
|
||||||
appdwarf $JDK
|
shift
|
||||||
mv $(basename $JDK).sh java
|
appdwarf $JDK $@
|
||||||
|
mv $(basename $JDK).sh java$ver
|
||||||
rm -rf $DIR
|
rm -rf $DIR
|
||||||
|
|
Loading…
Reference in a new issue