Skip to content

Instantly share code, notes, and snippets.

@ivan
Last active September 6, 2016 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ivan/0205915d65346da2b26f17ea5605f42f to your computer and use it in GitHub Desktop.
Save ivan/0205915d65346da2b26f17ea5605f42f to your computer and use it in GitHub Desktop.
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
@ivan
Copy link
Author

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