You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Dennis Patzer (JIRA)" <ji...@apache.org> on 2017/10/20 13:13:00 UTC

[jira] [Created] (CB-13475) Set an alternative user for cordova plugin add via git repo

Dennis Patzer created CB-13475:
----------------------------------

             Summary: Set an alternative user for cordova plugin add via git repo
                 Key: CB-13475
                 URL: https://issues.apache.org/jira/browse/CB-13475
             Project: Apache Cordova
          Issue Type: Bug
          Components: cordova-cli
    Affects Versions: 7.0.0
            Reporter: Dennis Patzer


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!??!



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org