summaryrefslogtreecommitdiff
path: root/fsmgr
blob: f2c6ff161ba4e2ea3d41f3bfee3e2b1c6e2b4627 (plain)
1
2
3
4
5
6
7
8
9
#!/bin/sh
die() { printf 'Error: %s\n' "$*" >&2; exit 1; }
root=$(stack path --local-install-root) || die "subcommand failed: 'stack path'"
bin=$root/bin/fsmgr
stack build
case "$(id -u)" in
    0) exec "$bin" "$@" ;;
    *) exec sudo -- "$bin" "$@" ;;
esac