mirror of
https://github.com/utdemir/nix-tree.git
synced 2024-09-11 22:57:09 +03:00
20 lines
418 B
Bash
Executable File
20 lines
418 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
if [[ "$1" == "check" ]]; then
|
|
ormolu_flags="--mode check"
|
|
nixpkgs_fmt_flags="--check"
|
|
elif [[ "$1" == "format" ]]; then
|
|
ormolu_flags="--mode inplace"
|
|
nixpkgs_fmt_flags=""
|
|
else
|
|
echo "Usage: $0 [check|format]"
|
|
exit 1
|
|
fi
|
|
|
|
set -o errexit
|
|
shopt -s globstar
|
|
set -o xtrace
|
|
|
|
ormolu $ormolu_flags {src,test}/**/*.hs
|
|
nixpkgs-fmt $nixpkgs_fmt_flags default.nix shell.nix flake.nix
|