Skip to content

Commit

Permalink
Merge pull request #1898 from digitallyinduced/fix-1787
Browse files Browse the repository at this point in the history
ihp-new: Create git repo to avoid issues when IHP is part of a larger git repo
  • Loading branch information
mpscholten authored Jan 23, 2024
2 parents 2802a71 + 016a14d commit a454f07
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 a454f07

Please sign in to comment.