blob: c9c06c09e8de6b548447d9feff806cbd8fad84f3 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
#!/usr/bin/env sh
ROOT="$(git rev-parse --show-toplevel)"
# This results in fd returning relative paths
cd "$ROOT/common" || echo "BUG, no root dir!"
file_spec="$(nix eval --file "$ROOT/common/default.nix" --json)"
echo "$file_spec" | jq --raw-output 'keys | join("\n")' | while read -r file; do
[ -n "$first_run_done" ] && echo
echo "Instantiating '$file'..."
echo "$file_spec" | jq --raw-output ".[\"$file\"] | join(\"\n\")" | while read -r language; do
template="$ROOT/templates/$language";
echo " done for '$language'."
mkdir --parents "$(dirname "$template/$file")"
rm "$template/$file"
cp "$file" "$template/$file"
done
first_run_done=yes
done
# vim: ft=sh
|