2
0
Fork 0
es5-ff-spa-loader/example/app_mobile/scripts/copy-ff-spa-loader-js.js
2016-02-16 16:09:23 +01:00

17 lines
532 B
JavaScript

var fs = require('fs');
module.exports = function(context) {
var Q = context.requireCordovaModule('q');
var deferral = new Q.defer();
console.log('copy-ff-spa-loader-js start');
fs.readFile('../../es5-ff-spa-loader.js',function(err,data) {
if (err) return deferral.reject(err);
fs.writeFile('www/es5-ff-spa-loader.js',data,function(err) {
if (err) return deferral.reject(err);
console.log('copy-ff-spa-loader-js done');
deferral.resolve();
})
});
return deferral.promise;
}