aem-project-archetype
aem-project-archetype copied to clipboard
Add an option to initialize a git repo with the base archetype files as the initial commit
As a person who has spun up many projects using this archetype, it would be nice it the archetype could initialize and commit the generated files at the end of the project generation.
Name: initGitRepo
Description: Initializes a git repo with the generated project files as the initial commit.
Options: y
(default), n
Commands to run (working directory would be the project dir that was generated):
-
git init
-
git add *
-
git add .gitignore
-
git commit -m "Initial commit."
If git
is not available, then the step can either fail hard, with only the default OS message about the missing command. Optionally, the script that runs the commands can first check for the existence of git
and provide a more user-friendly error message with a more graceful exit.
Since this would be the final step after the archetype has run, if the repo-creation steps fail, the project is still a valid project, but without the initialized git repo.