From 6c76f40315b0a0e855c6a867a0784209aef7b778 Mon Sep 17 00:00:00 2001
From: jurgenhaas <juergen@paragon-es.de>
Date: Thu, 13 Sep 2018 16:30:11 +0200
Subject: [PATCH] #5 Remove drupal.org username as the git URLs are changing
 and SSH pub key authentication is now required

---
 composer.json   |  1 -
 src/Handler.php | 14 ++++----------
 2 files changed, 4 insertions(+), 11 deletions(-)

diff --git a/composer.json b/composer.json
index b0b718e..c2f4caf 100644
--- a/composer.json
+++ b/composer.json
@@ -26,7 +26,6 @@
     "require": {
         "composer-plugin-api": "^1.0.0",
         "cypresslab/gitelephant": "~1.0",
-        "lakedrops/dotenv": "^0.1",
         "php": ">=5.6"
     },
     "require-dev": {
diff --git a/src/Handler.php b/src/Handler.php
index 088464c..5e365ff 100644
--- a/src/Handler.php
+++ b/src/Handler.php
@@ -6,7 +6,6 @@ use Composer\Composer;
 use Composer\IO\IOInterface;
 use Composer\Script\Event;
 use GitElephant\Repository;
-use LakeDrops\Component\Dotenv\Dotenv;
 use Symfony\Component\Filesystem\Filesystem;
 
 /**
@@ -84,7 +83,7 @@ class Handler {
 
       $path = $installationManager->getInstallPath($package);
       $this->io->write("- $project => $path", TRUE);
-      $this->prepareWorkingDirectory($path, $project, $version, $options['username']);
+      $this->prepareWorkingDirectory($path, $project, $version);
     }
   }
 
@@ -95,13 +94,10 @@ class Handler {
    *   The options.
    */
   protected function getOptions() {
-    $env = new Dotenv('dorgflow', $this->io);
     $extra = $this->composer->getPackage()->getExtra() + ['dorgflow' => []];
-    $options = $extra['dorgflow'] + [
+    return $extra['dorgflow'] + [
       'projects' => [],
-      'username' => $env->receive('drupal_org_username', 'Drupal.org username', getenv('USER')),
     ];
-    return $options;
   }
 
   /**
@@ -113,12 +109,10 @@ class Handler {
    *   Name of the project.
    * @param string $version
    *   Version to checkout.
-   * @param string $username
-   *   Username on drupal.org.
    */
-  protected function prepareWorkingDirectory($path, $project, $version, $username) {
+  protected function prepareWorkingDirectory($path, $project, $version) {
     list(, $projectname) = explode('/', $project);
-    $uri = $username . '@git.drupal.org:project/' . $projectname . '.git';
+    $uri = 'git@git.drupal.org:project/' . $projectname . '.git';
 
     // Git Clone the repository into the working directory.
     $repository = Repository::open($path);
-- 
GitLab