nix-files/pkgs/additional/sane-scripts/src/sane-sudo-redirect
Colin c50a4d1d71 static-nix-shell: fix mkBash scripts to actually be invokable from the CLI
they need the `bash` package! how did this work before?
2024-06-15 07:42:04 +00:00

18 lines
319 B
Plaintext
Executable File

#!/usr/bin/env nix-shell
#!nix-shell -i bash -p bash -p coreutils-full
# redirects to $1, when writing to $1 requires sudo permissions.
# i.e. convert a failing command:
#
# ```
# $ sudo do_thing > /into/file
# ```
#
# to
#
# ```
# $ sudo do_thing | sane-sudo-redirect /into/file
# ```
exec sudo tee "$@" > /dev/null