-
Notifications
You must be signed in to change notification settings - Fork 0
/
ginolv1.js
54 lines (37 loc) · 998 Bytes
/
ginolv1.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
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env node
/** Guillaume Isabelle GINOL
* Vision: Simple notification are received and a simple command generates them
* Current Reality: Gulp notify mastery
*/
var gulp = require("gulp");
var notify = require("gulp-notify");
var args = process.argv.slice(2);
var options = {onLast : true};
var state = 0;
var msg = args[0];
if (args[0]== "-f" || args[0]== "--f" ||args[0]== "--fail" || args[0]== "--failure" )
{ state=-1;
msg = args[1];
}
if (args[0]== "-s" || args[0]== "--s" ||args[0]== "--success" || args[0]== "--succeeding" )
{ state=1;
msg = args[1];
}
//@STCGoal Argument for FAILURE -f
//@STCGoal Argument for Success -s
//@Result Green = Success
if (state == 0)
console.log(msg);
else if (state == -1)
console.warn("FAILURE:: " + msg);
else if (state==1)
console.log("SUCCESS:: " + msg);
function myFunc(done) {
gulp.src('./')
.pipe(notify(msg,options)
);
}
// run our custom build
myFunc(function () {
console.log(msg + '\nDone!');
});