2
0
Fork 0
es5-ff-spa-loader/example/app_mobile/scripts/copy-ff-spa-loader-js.js

22 lines
547 B
JavaScript

var fs = require('fs');
var logger = require('console');
module.exports = function(context) {
var Q = context.requireCordovaModule('q');
var deferral = new Q.defer();
logger.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);
}
logger.log('copy-ff-spa-loader-js done');
deferral.resolve();
})
});
return deferral.promise;
}