Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.8.0
-
None
Description
This is a bit of a catch-all bug to describe the hiccups I've faced (so far) trying to get this to work.
(1) require-ing cordova (from a relative path, not sure if thats part of the problem) leads to errors when calling .config().
shell> cd MyCordovaCliApp
shell> node
node> var cordova = require('../cordova-cli/cordova');
node> cordova.config({})
TypeError: Arguments to path.join must be strings
at path.js:360:15
at Array.filter (native)
at Object.exports.join (path.js:358:36)
at Function.get_config [as read] (/Users/mmocny/dev/mobile-chrome-apps/cordova-cli/src/config.js:35:27)
at Object.config (/Users/mmocny/dev/mobile-chrome-apps/cordova-cli/src/config.js:27:31)
at repl:1:10
at REPLServer.self.eval (repl.js:110:21)
at Interface.<anonymous> (repl.js:239:12)
at Interface.EventEmitter.emit (events.js:95:17)
at Interface._onLine (readline.js:202:10)
(I worked around this locally by just modifying that config.json manually.)
(2) lazy loaded platforms copy with wrong permissions, which means the bin scripts to not be executable.
shell> path/to/cordova platform add android
[Error: An error occured during creation of android sub-project. /bin/sh: /Users/mmocny/.cordova/lib/android/cordova-master/master/bin/create: Permission denied
]
(I worked around this by manually chmod +x those files)
(3) cordova.js file is always expected to be found according to the latest tagged version, and not in your locally installed relative uri specified platform
shell> cordova platform add android
[Error: ENOENT, no such file or directory '/Users/mmocny/.cordova/lib/android/cordova/2.8.0/framework/assets/www/cordova.js']
(The actual version is found in /Users/mmocny/.cordova/lib/android/cordova-master/master/framework/assets/www/cordova.js)
(Seems the cause has to do with cordova_util.cordovaTag being hard coded to 2.8.0 and even if that adapted (to, say, dev as in my case), the full path to platform lib is still incorrectly hard coded throughout the platform parsers..)
The following are more usability concerns:
(4) When I make changes to my local platform, I seem to need to delete .cordova/libs in order for new changes to be copied over. Could we just link? Would solve the permissions errors..
(5) Why do we copy local platforms into .cordova/libs/ at all? It seems both needless and brittle.