mirror of
https://github.com/Llewellynvdm/nativefier.git
synced 2024-12-24 11:05:26 +00:00
29 lines
659 B
JavaScript
29 lines
659 B
JavaScript
import gulp from 'gulp';
|
|
import shellJs from 'shelljs';
|
|
import sourcemaps from 'gulp-sourcemaps';
|
|
import babel from 'gulp-babel';
|
|
|
|
function shellExec(cmd, silent, callback) {
|
|
shellJs.exec(cmd, {silent: silent}, (code, stdout, stderr) => {
|
|
if (code) {
|
|
callback(JSON.stringify({code, stdout, stderr}));
|
|
return;
|
|
}
|
|
callback();
|
|
});
|
|
}
|
|
|
|
function buildES6(src, dest, callback) {
|
|
return gulp.src(src)
|
|
.pipe(sourcemaps.init())
|
|
.pipe(babel())
|
|
.on('error', callback)
|
|
.pipe(sourcemaps.write('.'))
|
|
.pipe(gulp.dest(dest));
|
|
}
|
|
|
|
export default {
|
|
shellExec,
|
|
buildES6
|
|
};
|