From 9f3fc112ee5c2484cb2783d99c0805b3fafa9873 Mon Sep 17 00:00:00 2001 From: jurgenhaas <juergen@paragon-es.de> Date: Wed, 25 Oct 2017 15:52:30 +0200 Subject: [PATCH] #3 Configurable username for drupal.org --- README.md | 3 +-- composer.json | 1 + src/Handler.php | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 58304aa..c574958 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 e48e497..d7126b2 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 9fc8fd3..5382278 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; } -- GitLab