Create a gist now

Instantly share code, notes, and snippets.

@ivan /mkdeb.fish
Last active Sep 6, 2016

What would you like to do?
Scripting in fish
#!/usr/bin/fish
set here (pwd)
and set out $here/ubuntils.deb
and set git_temp (mktemp -d)
and cd $git_temp; and git clone -q -b bien ~/code/system/ubuntils
and set deb_temp (mktemp -d)
and cd $deb_temp
and echo "2.0" > debian-binary
and mkdir -p control data/usr/bin
and rsync -a --delete $git_temp/ubuntils/bin/ data/usr/bin/
and rsync -a --delete $here/control/ control/
and chmod -R go-w $deb_temp/
and cd $deb_temp/data
and find . -type f -printf '%P\0' | xargs -0 md5sum > ../control/md5sums
and tar --owner=root --group=root -cJf ../data.tar.xz *
and cd $deb_temp/control
and tar --owner=root --group=root -czf ../control.tar.gz *
and cd $deb_temp
and rm -f $out
and ar -qc $out debian-binary control.tar.gz data.tar.xz
Owner

ivan commented Sep 6, 2016

Don't delete; linked to from https://ludios.org/fish-for-zsh-users/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment