Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-13475

Set an alternative user for cordova plugin add via git repo

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 7.0.0
    • Fix Version/s: None
    • Component/s: cordova-cli
    • Labels:
      None

      Description

      Hello,

      I just tried to retrieve my cordova plugin which lives in a private repo from git ssh url. Therefore I want to use the SSH url which is the following:

      myuser@bitbucket.org:myuser/cordova-plugin-xyz.git

      As you can see the user is myuser.

      If I now run

      cordova plugin add git+ssh://myuser@bitbucket.org/myuser/cordova-plugin-xyz.git

      I get the following error:

      npm ERR! Command failed: git clone --template=/home/localuser/.npm/_git-remotes/_templates --mirror ssh://git@bitbucket.org/myuser/cordova-plugin-xyz.git /home/localuser/.npm/_git-remotes/ssh-git-bitbucket-org-myuser-cordova-plugin-xyz-git-160b6243 npm ERR! Klone in Bare-Repository '/home/localuser/.npm/_git-remotes/ssh-git-bitbucket-org-myuser-cordova-plugin-xyz-git-160b6243' ... npm ERR! repository access denied. npm ERR! fatal: Could not read from remote repository.

      As you can see cordova tries to get the plugin by the url

      ssh://git@bitbucket.org/myuser/cordova-plugin-xyz.git

      which sets git as user which is wrong in my case.

      The problem is that I have multiple accounts for bitbucket and also 2 ssh keys on my machine. Unfortunately, the cordova cli tool seems to force checking out by the user called "git" and not what I'm adding into the command (myuser).

      Is there any way to override that behavior of cordova cli to always take git as user?

      Also I tried to create a "config" file in ~/.ssh and vary the host (as described here developer.atlassian.com/blog/2016/04/… ) which also doesn't work (cordova cli tool says unsupported URL format).

      Why doesn't the cordova cli tool simply takes my url as passed in!??!

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              The_Unknown Dennis Patzer
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: