Skip to content

Commit b99cd74

Browse files
committed
Add sensible defaults for setup and environment commands that read and write a minimal .env file.
1 parent be03c6f commit b99cd74

3 files changed

Lines changed: 6 additions & 2 deletions

File tree

defaults/phapp.defaults.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ git:
1010
version_prefix: 'version/'
1111
sub-apps: []
1212
commands:
13+
setup: |
14+
echo PHAPP_ENV=$PHAPP_ENV > .env
15+
environment: |
16+
source .env
1317
clean: rm -rf ./vendor
1418
build: |
1519
composer install --no-dev --no-interaction

examples/phapp.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ git:
1515
mirror1: mirror1-url
1616
commands:
1717
setup: |
18-
echo $PHAPP_ENV > .env
18+
echo PHAPP_ENV=$PHAPP_ENV > .env
1919
environment: |
2020
source .env
2121
build: |

src/Commands/SetupCommands.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function setup($env = NULL) {
3535
// The setup command must work without a prepared environment; i.e. the
3636
// environment command is not yet available.
3737
$content = $this->phappManifest->getContent();
38-
unset($content['commands']['environment']);
38+
$content['commands']['environment'] = '';
3939
$this->phappManifest = new PhappManifest($content, $this->phappManifest->getFile());
4040
return $this->invokeManifestCommand('setup');
4141
}

0 commit comments

Comments
 (0)