Skip to content

Feature Request: Final Hook for Statamic CLI #98

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

Open
JelleGroenendal opened this issue Feb 21, 2025 · 0 comments
Open

Feature Request: Final Hook for Statamic CLI #98

JelleGroenendal opened this issue Feb 21, 2025 · 0 comments

Comments

@JelleGroenendal
Copy link

Summary

Add a final hook to the Statamic CLI that executes after all setup steps, including git init.

Current Limitation

Currently, there is only one hook available: StarterKitPostInstall.php. However, this hook runs before git init, which limits its usefulness for actions that require a fully initialized repository.

Proposed Solution

Introduce a final hook that runs after all installation steps are completed, including git init.

Use Cases

1. Push to a Git Repository (GitLab, GitHub, etc.)

Automatically add a remote Git repository and push the initialized project.

Example:

git remote add origin git@gitlab.com:username/repository.git
git push -u origin main

2. Run Additional Setup Scripts

Execute project-specific scripts after installation (e.g., CI/CD setup, permissions adjustments).

3. Notify External Services

Send a webhook or notification to an external service to confirm that project creation is complete.

4. Initialize Additional Tools

Set up tools like Laravel Envoyer, Forge, or deploy keys after Git setup.

Implementation Suggestion

  • Introduce a new hook, e.g., StarterKitFinalInstall.php, that runs at the very end of the process.
  • Ensure that it executes after git init and any other finalization steps.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants