about summary refs log tree commit diff stats
path: root/update_common_files.sh
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-06-11 08:00:45 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-06-11 08:00:45 +0200
commite4a334234b91f230571b5111a2b698230b27c660 (patch)
tree7545deca502c7ef7f676fc689f8caaeee6e19801 /update_common_files.sh
parentchore(templates/rust): Quickly Update [THIS WILL BE REBASED] (diff)
downloadflake-templates-e4a334234b91f230571b5111a2b698230b27c660.tar.gz
flake-templates-e4a334234b91f230571b5111a2b698230b27c660.zip
refactor(common): Use symlinks to state, which files should be replaced
Every symlink in the `./templates` directory is now replaced with
the file it points to, making it obvious that this file should not be
edited.
Diffstat (limited to '')
-rwxr-xr-xupdate_common_files.sh26
1 files changed, 0 insertions, 26 deletions
diff --git a/update_common_files.sh b/update_common_files.sh
deleted file mode 100755
index d204c17..0000000
--- a/update_common_files.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/usr/bin/env sh
-
-ROOT="$(git rev-parse --show-toplevel)"
-
-# This results in fd returning relative paths
-cd "$ROOT/common/files" || 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