I'm trying to figure out how to reconcile some Cordova + git "best practices" with what I think is reality, and I'm hoping someone can shed some light on this for me.
If I understand correctly, the current "best practice" is to add these directories to my .gitignore (from the book "Developing with Cordova CLI", the current version):
platforms/
plugins/
node_modules/
This removes the easily downloadable plugins and mostly boilerplate platform code from version control because it can be easily generated with a simple Cordova CLI command.
But, this seems counter-intuitive because - and I'm thinking like NPM or Bower - with the Cordova CLI I can't save which platforms and plugins I'm using in a config file. With NPM, I can add a --save
switch to save the package in the package.json
file. This allows me to not version control my node_modules folder and instead use 'npm install'. With the Cordova CLI I can't seem to use the --save
switch (is there an equivalent) to 'remember' the plugins or platforms I intend to use.
It seems that the config.xml
file in the www/
directory doesn't save which platforms or plugins have been added.
Is there some other file in the project that keeps a memory of which platforms and plugins I want to use? How does it work?
cordova platform add android
on Windows 7. Running command: cmd args=["/c","C:\\Program Files\\nodejs\\node.exe","C:\\path\\Dev\\GitHub\\app\\.cordova\\hook s\\before_platform_ls\\010_install_plugins.js","C:\\path\\Dev\\GitHub\\app"] 'C:\Program' is not recognized as an internal or external command, operable program or batch file. Hook failed with error code 1: node However, I can run the .js file directly with justnode \path\to\hook.js
and there is no error. I'm not sure what's going on... – Graven