Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I add a cordova plugin based on a Git branch?

I do have a git repository with a MASTER branch. I have now a new capability into a specific BRANCH of that same git project.

I wish to add the specific branch cordova plugin.

I'm aware of adding a cordova project based on GIT and GIT TAGS but I can't find anything in relation to a branch.

I'm looking for something like :

cordova plugin add https://mygitadresse/myproject#branch_name 

Thank for support and suggestion;

like image 347
aorfevre Avatar asked Sep 02 '16 16:09

aorfevre


2 Answers

If the project's github repository is branched properly, then you should be able to install the plugin using the specific branch in the github out of the box.

cordova plugin add https://git.example.com/myproject#branch_name 

Have look at Cordova connect plugin for instance where there is a provision to install versions older than 1.6.0 using sdk_1.3 branch just like the way you wanted. Hope it helps.

like image 168
Gandhi Avatar answered Oct 17 '22 05:10

Gandhi


If the plugin is not registered at registry.cordova.io but is located in another git repository, you can specify the git URL:

$ cordova plugin add https://github.com/apache/cordova-plugin-console.git

The git example above fetches the plugin from the end of the master branch, but an alternate git-ref such as a tag or branch can be appended after a # character:

$ cordova plugin add https://github.com/apache/cordova-plugin-console.git#r0.2.0

If the plugin (and its plugin.xml file) is in a subdirectory within the git repo, you can specify it with a : character. Note that the # character is still needed:

$ cordova plugin add https://github.com/someone/aplugin.git#:/my/sub/dir

You can also combine both the git-ref and the subdirectory:

$ cordova plugin add https://github.com/someone/aplugin.git#r0.0.1:/my/sub/dir

Reference: https://cordova.apache.org/docs/en/3.3.0/guide/cli/index.html

like image 10
Mukesh Chapagain Avatar answered Oct 17 '22 03:10

Mukesh Chapagain