-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgulpfile.coffee
69 lines (59 loc) · 2.03 KB
/
gulpfile.coffee
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
gulp = require "gulp"
notify = require "gulp-notify"
plumber = require "gulp-plumber"
changed = require "gulp-changed"
coffee = require "gulp-coffeescript"
sass = require "gulp-sass"
haml = require "gulp-haml"
yaml = require "gulp-yaml"
del = require "del"
path =
coffeeSrc: "src/**/*.coffee"
coffeeBin: "bin"
hamlSrc: "src/gui/**/*.haml"
hamlBin: "bin/gui"
scssSrc: "src/gui/css/**/*.scss"
scssBin: "bin/gui/css"
imgSrc: "src/gui/img/**"
imgBin: "bin/gui/img"
yamlSrc: "src/lang/**"
yamlBin: "bin/lang"
packageJsonSrc: "src/package.json"
packageJsonBin: "bin"
gulp.task "default", ["coffee", "haml", "scss", "img", "yaml", "package.json"]
gulp.task "coffee", ->
return gulp.src(path.coffeeSrc)
.pipe(plumber(errorHandler: notify.onError("Error: <%= error.toString() %>")))
.pipe(changed(path.coffeeBin))
.pipe(coffee(bare: true))
.pipe(gulp.dest(path.coffeeBin))
gulp.task "haml", ->
return gulp.src(path.hamlSrc)
.pipe(plumber({errorHandler: notify.onError("Error: <%= error.toString() %>")}))
.pipe(changed(path.hamlBin))
.pipe(haml())
.pipe(gulp.dest(path.hamlBin))
gulp.task "scss", ->
return gulp.src(path.scssSrc)
.pipe(plumber({errorHandler: notify.onError("Error: <%= error.toString() %>")}))
.pipe(changed(path.scssBin))
.pipe(sass())
.pipe(gulp.dest(path.scssBin))
gulp.task "img", ->
return gulp.src(path.imgSrc)
.pipe(plumber({errorHandler: notify.onError("Error: <%= error.toString() %>")}))
.pipe(changed(path.imgBin))
.pipe(gulp.dest(path.imgBin))
gulp.task "yaml", ->
return gulp.src(path.yamlSrc)
.pipe(plumber({errorHandler: notify.onError("Error: <%= error.toString() %>")}))
.pipe(changed(path.yamlBin))
.pipe(yaml())
.pipe(gulp.dest(path.yamlBin))
gulp.task "package.json", ->
return gulp.src(path.packageJsonSrc)
.pipe(plumber({errorHandler: notify.onError("Error: <%= error.toString() %>")}))
.pipe(changed(path.packageJsonBin))
.pipe(gulp.dest(path.packageJsonBin))
gulp.task "clean", (cb) ->
return del ["./bin"], cb