Reputation: 6349
I would like to know if there is a way to add cordova plugin through git ssh url.
I have some plugins privately hosted on GitHub. When I initiate the project, cordova will fetch them via https, because I have defined the dependencies in config.xml
as follows:
...
<plugin name="my-plugin" spec="https://github.com/me/my-plugin.git" />
...
But I have to type in my username and password every time cordova installs these plugins. So I want to use ssh url.
I have tried to use git://
. Cordova CLI says it is fetching the repo by cloning, but it does not install the plugin. I also tried using git@
but that one throws an invalid format error. I also tried writing custom shell scripts and running cordova plugin add git://...
but it did not work.
I am using the Cordova CLI v5.4.1, latest at the time of writing.
Upvotes: 7
Views: 6742
Reputation: 341
cordova plugin add git+ssh://%ssh-link-here%
It would look like
cordova plugin add git+ssh://[email protected]/path/to/plugin/repo.git
Upvotes: 17
Reputation: 1155
Its as simple as that, you can add your private plugin hosted in the git to your project via
cordova plugin add https://github.com/path to your repo /plugin-name.git
and then if required edit the config.xml accondingly
Upvotes: -3