diff --git a/README.md b/README.md index 58304aabef686c4e13b5a16407830fab5732a6fe..c574958390853c2035e2ce0681fa9401d7fd607d 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,6 @@ Here is a sample of what to add to your composer.json: { "extra": { "dorgflow": { - "username": "jurgenhaas", "projects": { "drupal/colorbox_field_formatter": "8.x-1.x", "drupal/dimension": "8.x-1.x", @@ -22,4 +21,4 @@ Here is a sample of what to add to your composer.json: } ``` -The, to gat it to work, simply call `composer require lakedrops/dorgflow` and everything will be traken care off for you automatically - even if you update your Drupal project at any time in the future, the development environments for your defined projects will be kept in place and properly configured. +Then, to get it to work, simply call `composer require lakedrops/dorgflow` and everything will be traken care off for you automatically - even if you update your Drupal project at any time in the future, the development environments for your defined projects will be kept in place and properly configured. diff --git a/composer.json b/composer.json index e48e4973f20f1e799486f23ba751bfdee0825242..d7126b268ee96ef4a9cd25da588c21dc2c4d960d 100644 --- a/composer.json +++ b/composer.json @@ -26,6 +26,7 @@ "require": { "composer-plugin-api": "^1.0.0", "cypresslab/gitelephant": "~1.0", + "lakedrops/dotenv": "^0.1", "php": ">=5.4.5" }, "autoload": { diff --git a/src/Handler.php b/src/Handler.php index 9fc8fd348113ba88df9253b1f4773992a7327aa4..53822783bf48f1926be008598a83094d548f7280 100644 --- a/src/Handler.php +++ b/src/Handler.php @@ -7,6 +7,7 @@ use Composer\Composer; use Composer\IO\IOInterface; use Composer\Script\Event as ScriptEvent; use GitElephant\Repository; +use LakeDrops\Component\Dotenv\Dotenv; use Symfony\Component\Filesystem\Filesystem; class Handler { @@ -76,10 +77,11 @@ class Handler { * @return array */ protected function getOptions() { + $env = new Dotenv('dorgflow', $this->io); $extra = $this->composer->getPackage()->getExtra() + ['dorgflow' => []]; $options = $extra['dorgflow'] + [ 'projects' => [], - 'username' => '', + 'username' => $env->receive('drupal_org_username', 'Drupal.org username', getenv('USER')), ]; return $options; }