Skip to content

Commit

Permalink
fix prod build
Browse files Browse the repository at this point in the history
  • Loading branch information
opus1269 committed May 22, 2019
1 parent c31b424 commit b21f9c9
Showing 1 changed file with 25 additions and 8 deletions.
33 changes: 25 additions & 8 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,16 +104,33 @@ const REP_CP = '';

// copy a directory - Windows only
// preconditions: srcDir and destDir set
function copyDir(done) {
const child = require('child_process');
function copyDirWindows(done) {
const from = srcDir.replace(/\//gim, '\\');
const to = destDir.replace(/\//gim, '\\');
const command = `xcopy /y /q /s "${from}\\*" "${to}\\"`;
console.log(command);
const command = 'xcopy';
console.log(`copying ${from} to ${to} ...`);

child.exec(command);
const args = [
'/y',
'/q',
'/s',
`${from}\\*`,
`${to}\\`,
];
const copy = spawn(command, args);

copy.stdout.on('data', (data) => {
console.log(data.toString());
});

done();
copy.stderr.on('data', (data) => {
console.log(`stderr: ${data.toString()}`);
});

copy.on('exit', (code) => {
console.log(`${command} exited with code ${code.toString()}`);
done();
});
}

// Development build
Expand Down Expand Up @@ -148,8 +165,8 @@ function buildProd(done) {
zipDirectory = 'build/prod';
manifestDest = 'build/prodTest/app';

return gulp.series(jsLint, tsLint, tsCompile, polyBuildProd,
copyDir, manifest, jsDelete, zipBuild, prodTestDelete, docs)(done);
return gulp.series(jsLint, tsLint, tsCompile, polyBuildProd, manifest,
copyDirWindows, docs, jsDelete, zipBuild, prodTestDelete)(done);
}

// watch for file changes
Expand Down

0 comments on commit b21f9c9

Please sign in to comment.