-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgulpfile.js
51 lines (46 loc) · 1.45 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
39
40
41
42
43
44
45
46
47
48
49
50
51
const gulp = require('gulp');
const sassLint = require('gulp-sass-lint');
const inject = require('gulp-inject');
const clean = require('gulp-clean');
gulp.task('lint-styles', function() {
gulp.src([
'app/stylesheets/**/*.scss',
'!app/stylesheets/leaflet/prune-cluster.scss', // vendor file
])
.pipe(sassLint())
.pipe(sassLint.format())
.pipe(sassLint.failOnError());
});
gulp.task('copy:index', function() {
const cssStream = gulp
.src('style.css', {read: false, cwd: __dirname + '/dist/'});
gulp.src('app/index.html')
.pipe(inject(cssStream, {removeTags: true}))
.pipe(gulp.dest('dist/'));
});
gulp.task('clean:dist', function () {
return gulp.src('dist', {read: false})
.pipe(clean());
});
gulp.task('copy:static', function() {
gulp.src(['app/images/**/*']).pipe(gulp.dest('dist/images'));
gulp.src(['app/favicon.ico']).pipe(gulp.dest('dist'));
gulp.src(['app/layers/**/*']).pipe(gulp.dest('dist/layers'));
gulp.src(['app/data/**/*']).pipe(gulp.dest('dist/data'));
gulp.src(['1.dist/**/*']).pipe(gulp.dest('dist/1.dist'));
});
gulp.task('slack-notify', function() {
var fs = require('fs');
try {
var SLACK_URL = fs.readFileSync('slackHookURL.txt','utf8');
} catch (err) {
console.log(err);
return
}
var slack = require('slack-notify')(SLACK_URL);
slack.alert({
channel: '#tanzania-dashboards',
icon_emoji: ':heart_decoration: ',
text: 'http://afya.takwimu.org/'
});
});