-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
38 lines (33 loc) · 1.76 KB
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/**
* GULP file tasks
*/
const
env = require('env2')('./package.json'),
gulp = require("gulp"),
clean = require('gulp-clean'),
run = require('gulp-run'),
runSequence = require('run-sequence');
gulp.task('pack', function () {
console.log('┌────────────────────────────────────────┐');
console.log('│ Packing module with NPM │ ');
console.log('└────────────────────────────────────────┘');
return run('npm pack').exec()
.pipe(gulp.dest('output'));
});
gulp.task('build', function() {
console.log('┌────────────────────────────────────────┐');
console.log('│ Installing the package globally │');
console.log('└────────────────────────────────────────┘');
return run(`npm install -g ${process.env.name}-${process.env.version}.tgz`).exec()
.pipe(gulp.dest('output'));
});
gulp.task('clean', function () {
console.log('┌────────────────────────────────────────┐');
console.log('│ A little housekeeping │ ');
console.log('└────────────────────────────────────────┘');
return gulp.src(`${process.env.name}-${process.env.version}.tgz`, {read: false})
.pipe(clean());
});
gulp.task('install', function(callback) {
runSequence('pack', 'build', 'clean')
});