Skip to content
This repository has been archived by the owner on Apr 21, 2020. It is now read-only.

Commit

Permalink
Merge pull request #41 from don/cordovajs
Browse files Browse the repository at this point in the history
copy cordva.js for android without the version suffix
  • Loading branch information
Fil Maj committed Apr 4, 2013
2 parents 0fa8525 + 5812490 commit b144e75
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/build/makers/android.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,9 @@ module.exports = function(output, sha, devices, entry_point, callback) {
fs.writeFileSync(configFile, fs.readFileSync(configFile, 'utf-8').replace(/<content\s*src=".*"/gi, '<content src="' +entry_point + '"'), 'utf-8');

// look at which cordova-<v>.js current lib uses
var cordovajs = path.join(output, 'assets', 'www', 'cordova.js');
if (fs.existsSync(cordovajs)) {
var version = fs.readFileSync(path.join(android_lib, 'VERSION'), 'utf-8').replace(/\r?\n/,'');
fs.writeFileSync(cordovajs, fs.readFileSync(cordovajs, 'utf-8').replace(/var VERSION='.*';/, "var VERSION='" + version + "';"), 'utf-8');
}
var final_cordovajs = path.join(output, 'assets', 'www', 'cordova.js');
var lib_cordovajs = path.join(android_lib, 'framework', 'assets', 'js', 'cordova.android.js');
fs.writeFileSync(final_cordovajs, fs.readFileSync(lib_cordovajs, 'utf-8'), 'utf-8');
} catch (e) {
error_writer('android', sha, 'Exception thrown modifying Android mobile spec application.', e.message);
callback(true);
Expand Down

0 comments on commit b144e75

Please sign in to comment.