M.S.Naidu
M.S.Naidu

Reputation: 2289

Adding plugins from specific revision Github project to the Cordova project

I have setup the android project using cordova command-line-interface with the help of node.js. I have added the required plugin from Github to our project by the following command:

C:Users/Admin/>cordova plugin add https://github.com/phonegap-build/PushPlugin.git

For now it is working fine, but what if they suddenly changes the plugin.So I want to stick with the specific revision of plugin. So how can i get the plugin which is specific to particular revision. Shall i add the revision number or commit number to the above url?

Upvotes: 45

Views: 29139

Answers (2)

M.S.Naidu
M.S.Naidu

Reputation: 2289

I got the answer finally, I could get the plugin code upto particular commit:

The following command is what I used to get the latest plugin code:

D:sampleproject/>

cordova plugin add https://github.com/phonegap-build/PushPlugin#2345fd8fe48572eae3df631cf8fb262ef2804779

Upvotes: 64

Dick van den Brink
Dick van den Brink

Reputation: 14499

I don't know a way to stick to a particular revision (other than cloning it first and after the clone add it with a file path) but I know it is possible to install from a specific git tag which might be sufficient in most cases.

Command to install from a specific git tag

cordova plugin add https://github.com/phonegap-build/PushPlugin.git#1.3.4

If you want to install from a tag and a specified sub directory (maybe because plugin.xml isn't a top-level file) you can install it with this command: cordova plugin add https://github.com/phonegap-build/PushPlugin.git#1.3.4:/plugin/sub/dir

Upvotes: 34

Related Questions