phaser/copy-to-examples.js

33 lines
715 B
JavaScript
Raw Normal View History

2017-10-11 16:06:21 +00:00
let fs = require('fs-extra');
let sloc = require('node-sloc');
2017-10-11 16:06:21 +00:00
let source = './dist/phaser.js';
2018-01-09 22:29:08 +00:00
let dest = '../phaser3-examples/public/build/dev.js';
if (fs.existsSync(dest))
{
fs.copy(source, dest, function (err) {
if (err)
{
return console.error(err);
}
console.log('Build copied to ' + dest);
2017-10-11 16:06:21 +00:00
const options = {
path: './src',
extensions: [ '.js' ]
};
sloc(options).then((res) => {
console.log('Source files: ' + res.sloc.files + '\nLines of code: ' + res.sloc.sloc);
});
});
}
else
{
2018-01-09 22:29:08 +00:00
console.log('Copy-to-Examples failed: Phaser 3 Examples not present at ../phaser3-examples');
}