diff options
author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-06-11 08:07:43 +0200 |
---|---|---|
committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-06-11 08:07:43 +0200 |
commit | 7028841b501e3411d3f446d2bcde99c0382085ce (patch) | |
tree | 26da33c04ce1d15bbb93aa68c8d90e4939f3155d /instantiate_templates.sh | |
parent | fix(templates): Remove last remnants of the old in-place instantiating system (diff) | |
download | flake-templates-7028841b501e3411d3f446d2bcde99c0382085ce.tar.gz flake-templates-7028841b501e3411d3f446d2bcde99c0382085ce.zip |
fix(instantiate_templates.sh): Ensure that the `./build` dir matches reality
Diffstat (limited to 'instantiate_templates.sh')
-rwxr-xr-x | instantiate_templates.sh | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/instantiate_templates.sh b/instantiate_templates.sh index eaffcb2..8b7b3e8 100755 --- a/instantiate_templates.sh +++ b/instantiate_templates.sh @@ -14,6 +14,8 @@ ROOT="$(git rev-parse --show-toplevel)" DRY_RUN_CMD="" +# TODO: Find a way to do the building step incrementally (i.e. without removing everything) <2024-06-11> +[ -n "$ROOT" ] && $DRY_RUN_CMD rm --recursive "$ROOT/build" $DRY_RUN_CMD mkdir --parents "$ROOT/build" fd . "$ROOT/templates" --max-depth 1 --type directory | while read -r template; do @@ -31,11 +33,11 @@ fd . "$ROOT/templates" --max-depth 1 --type directory | while read -r template; symlink_path="$(readlink --canonicalize "$symlink")" if stringContain "$ROOT" "$symlink_path"; then - echo "Instantiating symlink: '.${symlink#"$ROOT"}'.." + echo " -> Instantiating symlink: '.${symlink#"$ROOT"}'.." $DRY_RUN_CMD rm "$symlink" $DRY_RUN_CMD cp "$symlink_path" "$symlink" else - echo "Not instantiating symlink '.${symlink#"$ROOT"}', as it points outside the repo!" + echo " -> Not instantiating symlink '.${symlink#"$ROOT"}', as it points outside the repo!" fi done done |