Skip to content

Commit

Permalink
[N/A] Disable Composer Script if not in Dev Mode (#156)
Browse files Browse the repository at this point in the history
* [N/A] Disable Composer Script if not in Dev Mode

* [N/A] Bail early if not in Dev Mode.
  • Loading branch information
bd-viget authored Oct 16, 2024
1 parent c615cd5 commit 4e4e59d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ class PostCreateProjectScript extends ComposerScript {
public static function execute( Event $event ): void {
self::setEvent( $event );

// Do not run on deployment.
if ( ! $event->isDevMode() ) {
return;
}

if ( ! self::needsSetup() ) {
return;
}
Expand Down
5 changes: 5 additions & 0 deletions bin/composer-scripts/ProjectEvents/PostInstallScript.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ class PostInstallScript extends ComposerScript {
public static function init( Event $event, bool $fromExecute = false ): void {
self::setEvent( $event );

// Do not run on deployment.
if ( ! $event->isDevMode() ) {
return;
}

// Load DDEV Environment variables.
self::loadDDEVEnvironmentVars();

Expand Down

0 comments on commit 4e4e59d

Please sign in to comment.