From 7028841b501e3411d3f446d2bcde99c0382085ce Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Tue, 11 Jun 2024 08:07:43 +0200 Subject: fix(instantiate_templates.sh): Ensure that the `./build` dir matches reality --- instantiate_templates.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'instantiate_templates.sh') 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 -- cgit 1.4.1