2017-10-11 16:06:21 +00:00
|
|
|
let fs = require('fs-extra');
|
2018-07-11 11:34:12 +00:00
|
|
|
let sloc = require('node-sloc');
|
2016-11-24 01:35:02 +00:00
|
|
|
|
2018-02-13 03:42:57 +00:00
|
|
|
let source = './build/phaser.js';
|
|
|
|
let sourceMap = './build/phaser.js.map';
|
2018-01-09 22:29:08 +00:00
|
|
|
let dest = '../phaser3-examples/public/build/dev.js';
|
2018-02-13 03:23:16 +00:00
|
|
|
let destMap = '../phaser3-examples/public/build/phaser.js.map';
|
2018-07-27 07:33:51 +00:00
|
|
|
let destFB = '../fbtest1/lib/dev.js';
|
|
|
|
let destFBMap = '../fbtest1/lib/phaser.js.map';
|
2016-11-24 01:35:02 +00:00
|
|
|
|
2018-04-13 16:05:45 +00:00
|
|
|
let sourceCore = './build/phaser-core.js';
|
|
|
|
let sourceMapCore = './build/phaser-core.js.map';
|
|
|
|
let destCore = '../phaser3-examples/public/build/phaser-core.js';
|
|
|
|
let destMapCore = '../phaser3-examples/public/build/phaser-core.js.map';
|
|
|
|
|
2018-07-27 07:33:51 +00:00
|
|
|
if (fs.existsSync(destFB))
|
|
|
|
{
|
|
|
|
fs.copy(source, destFB, function (err) {
|
|
|
|
|
|
|
|
if (err)
|
|
|
|
{
|
|
|
|
return console.error(err);
|
|
|
|
}
|
|
|
|
|
|
|
|
console.log('Build copied to ' + destFB);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
fs.copy(sourceMap, destFBMap, function (err) {
|
|
|
|
|
|
|
|
if (err)
|
|
|
|
{
|
|
|
|
return console.error(err);
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2017-09-22 10:47:20 +00:00
|
|
|
if (fs.existsSync(dest))
|
|
|
|
{
|
2018-04-13 16:05:45 +00:00
|
|
|
fs.copy(sourceMapCore, destMapCore, function (err) {
|
|
|
|
|
|
|
|
if (err)
|
|
|
|
{
|
|
|
|
return console.error(err);
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
fs.copy(sourceCore, destCore, function (err) {
|
|
|
|
|
|
|
|
if (err)
|
|
|
|
{
|
|
|
|
return console.error(err);
|
|
|
|
}
|
|
|
|
|
2018-05-16 13:53:15 +00:00
|
|
|
console.log('Build copied to ' + destCore);
|
|
|
|
|
2018-04-13 16:05:45 +00:00
|
|
|
});
|
|
|
|
|
2018-02-13 03:23:16 +00:00
|
|
|
fs.copy(sourceMap, destMap, function (err) {
|
|
|
|
|
|
|
|
if (err)
|
|
|
|
{
|
|
|
|
return console.error(err);
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
2017-09-22 10:47:20 +00:00
|
|
|
fs.copy(source, dest, function (err) {
|
2016-11-24 01:35:02 +00:00
|
|
|
|
2017-09-22 10:47:20 +00:00
|
|
|
if (err)
|
|
|
|
{
|
|
|
|
return console.error(err);
|
|
|
|
}
|
2016-11-24 01:35:02 +00:00
|
|
|
|
2017-09-22 10:47:20 +00:00
|
|
|
console.log('Build copied to ' + dest);
|
2016-11-24 01:35:02 +00:00
|
|
|
|
2017-10-11 16:06:21 +00:00
|
|
|
const options = {
|
|
|
|
path: './src',
|
|
|
|
extensions: [ '.js' ]
|
|
|
|
};
|
|
|
|
|
2018-07-11 11:34:12 +00:00
|
|
|
sloc(options).then((res) => {
|
|
|
|
console.log('Source files: ' + res.sloc.files + '\nLines of code: ' + res.sloc.sloc);
|
|
|
|
});
|
2017-10-11 16:06:21 +00:00
|
|
|
|
2017-09-22 10:47:20 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2018-01-09 22:29:08 +00:00
|
|
|
console.log('Copy-to-Examples failed: Phaser 3 Examples not present at ../phaser3-examples');
|
2017-09-22 10:47:20 +00:00
|
|
|
}
|