1
0
Fork 0
mirror of https://github.com/Phantop/dotfiles synced 2024-11-18 04:42:49 +00:00
dotfiles/dot-local/bin/foldwarf

20 lines
290 B
Plaintext
Raw Normal View History

#!/bin/sh
H=/tmp/folheader
echo '#!/bin/sh' > $H
echo D=\"$1\" >> $H
cat >> $H <<'EOF'
if [ ! -d "$D" ]; then
mkdir "$D"
dwarfs -o offset=auto "$0" "$D"
else
fusermount -u "$D"
rmdir "$D"
fi
exit
EOF
shift
mkdwarfs -i . -o "$PWD.sh" --header $H $@
chmod +x "$PWD.sh"
rm $H