diff --git a/src/Actions/CodeUpAction.php b/src/Actions/CodeUpAction.php index 4a4fadb..1693500 100644 --- a/src/Actions/CodeUpAction.php +++ b/src/Actions/CodeUpAction.php @@ -18,6 +18,8 @@ class CodeUpAction extends StageAwareBaseAction { + public string $commitMessage = "init Craft"; + public function __construct( string $id, Commands $controller, @@ -92,7 +94,13 @@ public function run(?string $stage = null): int if ($status = $git->getWorkingCopy()->getStatus()) { // Changed files $this->noteBlock('Uncommitted changes:' . PHP_EOL . $status); - $defaultMessage = $this->interactive ? null : 'init Craft'; + + $commitMessage = $this->commitMessage; + if ($this->commitMessage == "1") { + $commitMessage = "init Craft"; + } + + $defaultMessage = $this->interactive ? null : $commitMessage; if (! $msg = $this->ask( 'Enter a commit message, or leave it empty to abort the commit', diff --git a/src/Plugin.php b/src/Plugin.php index 078adaf..d96575a 100644 --- a/src/Plugin.php +++ b/src/Plugin.php @@ -125,6 +125,7 @@ private function registerConsoleCommands(): void 'a' => 'app', 'e' => 'env', 'f' => 'force', + 'm' => 'commitMessage', ]; $group = (new ActionGroup('copy', 'Copy Craft between environments.'))