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:

[email protected]:myuser/cordova-plugin-xyz.git
As you can see the user is myuser.

If I now run

cordova plugin add git+ssh://[email protected]/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://[email protected]/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://[email protected]/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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to