Pull more of the scripts to their own files

Fixes #19
This commit is contained in:
Greg Hellings
2024-11-18 23:37:30 -06:00
parent f14c55e0c9
commit 1864511341
3 changed files with 44 additions and 32 deletions
+27
View File
@@ -0,0 +1,27 @@
{
writeShellApplication,
bash,
coreutils,
curl,
jq,
pup,
}:
writeShellApplication {
name = "generate";
runtimeInputs = [
bash
coreutils
curl
jq
pup
];
text = ''
shopt -s globstar
for vars in distros/**/*.pkrvars.hcl.sh; do
bash "./''${vars}"
done
set -x
echo "BUILD=$(date "+%Y.%m.%d.%H")" >> build.env
'';
}
+15
View File
@@ -0,0 +1,15 @@
{ writeShellApplication, shellcheck }:
writeShellApplication {
name = "shellcheck";
runtimeInputs = [
shellcheck
];
text = ''
scripts=()
shopt -s globstar
for f in **/*.sh; do
scripts+=("$f")
done
shellcheck -e SC2239 "''${scripts[@]}"
'';
}