Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ihp-new: Create git repo to avoid issues when IHP is part of a larger git repo #1898

Merged
merged 1 commit into from
Jan 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading