From 016a14da143b7ccf77c4e900e21205fa0aa7d7a1 Mon Sep 17 00:00:00 2001 From: Marc Scholten Date: Tue, 23 Jan 2024 12:07:38 +0100 Subject: [PATCH] ihp-new: Create git repo to avoid issues when IHP is part of a larger git repo Fixes https://github.com/digitallyinduced/ihp/issues/1787 --- ProjectGenerator/bin/ihp-new | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ProjectGenerator/bin/ihp-new b/ProjectGenerator/bin/ihp-new index f0bd4b7dc..f85039bb6 100755 --- a/ProjectGenerator/bin/ihp-new +++ b/ProjectGenerator/bin/ihp-new @@ -235,6 +235,15 @@ cd "$PROJECT_NAME" rm -rf ".git" chmod go-w .ghci || true +# Init git repo +# When the IHP project is created inside a larger git repo, nix will not pick up file changes until they've been `git add`ed. We create our own git repo here to avoid any issues related to that. +# See https://github.com/digitallyinduced/ihp/issues/1787 +git init +git add . + +# Disable nix warning like `warning: Git tree '...' is dirty` +export NIX_CONFIG="warn-dirty = false" + # Generating Web/ directory nix --extra-experimental-features "nix-command flakes" develop --impure --accept-flake-config --command bash -c "make -s all; new-application Web" @@ -250,6 +259,9 @@ elif [[ "$BOILERPLATE_GIT_BRANCH" == "purescript-halogen" ]]; then rm Layout.hs.patch Welcome.hs.patch fi +# Add remaining changes +git add . + echo "" echo "🚀 Project created, happy coding :)" echo "You can start the server by running:"