mirror of
https://github.com/Phantop/appdwarf.git
synced 2025-06-21 11:51:03 +00:00
appdwarf: Replace the folder header with an AppRun using bindfs
This commit is contained in:
parent
3ebee5f254
commit
654eea6fab
9
DirRun
Executable file
9
DirRun
Executable file
|
@ -0,0 +1,9 @@
|
||||||
|
#!/bin/sh
|
||||||
|
DIR=
|
||||||
|
if [ ! -d "$DIR" ]; then
|
||||||
|
mkdir "$DIR"
|
||||||
|
bindfs --no-allow-other "$APPDIR" "$DIR"
|
||||||
|
else
|
||||||
|
fusermount -u "$DIR"
|
||||||
|
rmdir "$DIR"
|
||||||
|
fi
|
14
appdwarf
14
appdwarf
|
@ -5,7 +5,6 @@ if [ $# -eq 0 ] || [ "$1" = -h ] || [ "$1" = --help ]; then # print help text
|
||||||
echo "Compress a given AppDir (default)"
|
echo "Compress a given AppDir (default)"
|
||||||
tput setaf 7
|
tput setaf 7
|
||||||
echo " -a, --appimage Convert a given AppImage to appdwarf"
|
echo " -a, --appimage Convert a given AppImage to appdwarf"
|
||||||
echo " -f, --folder Make image mount to a given folder (no AppRun)"
|
|
||||||
echo " -u, --url Fetch and convert AppImage from URL"
|
echo " -u, --url Fetch and convert AppImage from URL"
|
||||||
echo; tput setaf 5
|
echo; tput setaf 5
|
||||||
echo " -h, --help Print this help text"
|
echo " -h, --help Print this help text"
|
||||||
|
@ -20,17 +19,10 @@ HEAD="$(dirname "$(readlink -f "${0}")")/header"
|
||||||
while true; do # process args
|
while true; do # process args
|
||||||
case "$1" in
|
case "$1" in
|
||||||
--appimage | -a)
|
--appimage | -a)
|
||||||
app="$2"
|
app="$2" ;;
|
||||||
shift ;;
|
|
||||||
--folder | -f)
|
|
||||||
"$HEAD"_folder
|
|
||||||
HEAD=/tmp/dwarfhead
|
|
||||||
sed -i "2s|$|\"$2\"|" "$HEAD"
|
|
||||||
shift ;;
|
|
||||||
--url | -u)
|
--url | -u)
|
||||||
app=$(basename "$2")
|
app=$(basename "$2")
|
||||||
aria2c -x16 -s16 "$2" -o "$app" || wget "$2" -O "$app"
|
aria2c -x16 -s16 "$2" -o "$app" || wget "$2" -O "$app" ;;
|
||||||
shift ;;
|
|
||||||
--version | -v)
|
--version | -v)
|
||||||
tput setaf 2; echo appdwarf v3.0
|
tput setaf 2; echo appdwarf v3.0
|
||||||
tput setaf 4; echo Built by July 🏳️🌈
|
tput setaf 4; echo Built by July 🏳️🌈
|
||||||
|
@ -39,7 +31,7 @@ while true; do # process args
|
||||||
shift; break;;
|
shift; break;;
|
||||||
*)
|
*)
|
||||||
break;;
|
break;;
|
||||||
esac; shift
|
esac; shift 2
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ -n "$app" ]; then # handle and extract appimage input, if present
|
if [ -n "$app" ]; then # handle and extract appimage input, if present
|
||||||
|
|
|
@ -1,14 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
cat > /tmp/dwarfhead << 'EOF'
|
|
||||||
#!/bin/sh
|
|
||||||
DIR=
|
|
||||||
if [ ! -d "$DIR" ]; then
|
|
||||||
mkdir "$DIR"
|
|
||||||
ARG="-o offset=auto -o tidy_strategy=swap -o workers=4"
|
|
||||||
dwarfs $ARG "$0" "$DIR" 2>/dev/null
|
|
||||||
else
|
|
||||||
fusermount -u "$DIR"
|
|
||||||
rmdir "$DIR"
|
|
||||||
fi
|
|
||||||
exit
|
|
||||||
EOF
|
|
Loading…
Reference in a new issue