Updated copy scripts

This commit is contained in:
Richard Davey 2023-03-22 16:05:29 +00:00
parent d5cfea045c
commit e9a34bfedc
3 changed files with 38 additions and 32 deletions

View file

@ -0,0 +1,34 @@
let fs = require('fs-extra');
let source = './build/phaser.esm.js';
let sourceMap = './build/phaser.esm.js.map';
let dest = '../phaser3-examples/public/build/dev.esm.js';
let destDir = '../phaser3-examples/public/build/';
let destMap = '../phaser3-examples/public/build/phaser.esm.js.map';
if (fs.existsSync(destDir))
{
fs.copy(sourceMap, destMap, function (err) {
if (err)
{
return console.error(err);
}
});
fs.copy(source, dest, function (err) {
if (err)
{
return console.error(err);
}
console.log('Build copied to ' + dest);
});
}
else
{
console.log('Copy-to-Examples failed: Phaser 3 Examples not present at ../phaser3-examples');
}

View file

@ -3,9 +3,10 @@ let fs = require('fs-extra');
let source = './build/phaser.js'; let source = './build/phaser.js';
let sourceMap = './build/phaser.js.map'; let sourceMap = './build/phaser.js.map';
let dest = '../phaser3-examples/public/build/dev.js'; let dest = '../phaser3-examples/public/build/dev.js';
let destDir = '../phaser3-examples/public/build/';
let destMap = '../phaser3-examples/public/build/phaser.js.map'; let destMap = '../phaser3-examples/public/build/phaser.js.map';
if (fs.existsSync(dest)) if (fs.existsSync(destDir))
{ {
fs.copy(sourceMap, destMap, function (err) { fs.copy(sourceMap, destMap, function (err) {

View file

@ -4,39 +4,10 @@ let sloc = require('node-sloc');
let source = './build/phaser.js'; let source = './build/phaser.js';
let sourceMap = './build/phaser.js.map'; let sourceMap = './build/phaser.js.map';
let dest = '../phaser3-examples/public/build/dev.js'; let dest = '../phaser3-examples/public/build/dev.js';
let destDir = '../phaser3-examples/public/build/';
let destMap = '../phaser3-examples/public/build/phaser.js.map'; let destMap = '../phaser3-examples/public/build/phaser.js.map';
let sourceFB = './build/phaser-facebook-instant-games.js'; if (fs.existsSync(destDir))
let sourceFBMap = './build/phaser-facebook-instant-games.js.map';
let destFB = '../fbtest1/lib/dev.js';
let destFBMap = '../fbtest1/lib/phaser.js.map';
/*
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);
}
});
}
*/
if (fs.existsSync(dest))
{ {
fs.copy(sourceMap, destMap, function (err) { fs.copy(sourceMap, destMap, function (err) {