Skip to content

Commit

Permalink
ihp-new: Create git repo to avoid issues when IHP is part of a larger…
Browse files Browse the repository at this point in the history
… git repo

Fixes #1787
  • Loading branch information
mpscholten committed Jan 23, 2024
1 parent 2802a71 commit 016a14d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions ProjectGenerator/bin/ihp-new
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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:"
Expand Down

0 comments on commit 016a14d

Please sign in to comment.