shrub/sh/mk-bootbus

22 lines
356 B
Plaintext
Raw Normal View History

2019-03-05 03:43:53 +03:00
#!/usr/bin/env bash
set -e
case $# in
0) target=./bootbus;;
1) target=$1;;
*) echo "Usage: $0 [target]" >&2
exit 1;;
esac
if [ -e "$target" ]
then echo "Target directory '$target' already exists." >&2
exit 1
fi
pkg=$(nix-build nix/ops -A bootbus --no-out-link)
mkdir -p "$(dirname "$target")"
cp -r $pkg/ $target
2019-03-05 03:43:53 +03:00
chmod -R u+rw $target