Initialize git repo before template dependecies are installed
Created by: lukaszfiszer
Is your proposal related to a problem?
When creating a react app with a template that include a dependency requiring a git repo to work, the installation can fail or be incorrect for the developer that executes create-react-app on their machine. This is because the git repo is initialized after template dependencies are installed.
An example is a very popular package husky which adds git hooks to .git
directory as part of its postinstall scripts. Those hooks won't be added for the person setting up the app with npx create-react-app ...
Describe the solution you'd like
- split tryGitInit() into 2 separate functions - one that initializes the repo, second that creates commit.
- move execution of the first function up, possible at the beginning of main
init.js function
If you are OK with the proposed solution I'll be happy to prepare PR with the implementation.