1
0
Fork 0
mirror of https://github.com/Phantop/dotfiles synced 2024-11-22 23:02:46 +00:00
dotfiles/.local/bin/foldwarf

25 lines
426 B
Bash
Executable file

#!/bin/sh
a=../appdir
mkdir $a
mkdwarfs -i . -o $a/root.dwarfs
echo '#!/bin/sh' > $a/AppRun
echo D=$@ >> $a/AppRun
cat >> $a/AppRun <<'EOF'
H=$(dirname $(readlink -f "${0}"))
if [ ! -d $D ]; then
mkdir $D
dwarfs2 $H/root.dwarfs $D
else
fusermount -u $D
rmdir $D
fi
EOF
chmod +x $a/AppRun
mksquashfs $a ../app.sfs -noD
cat $(which appimageruntime) ../app.sfs > $PWD.sh
chmod +x "$PWD.sh"
rm -r $a ../app.sfs