forked from nth-cloud/ng-toggle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
28 lines (25 loc) · 1.08 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
const gulp = require('gulp');
const ghPages = require('gulp-gh-pages');
const clangFormat = require('clang-format');
const gulpFormat = require('gulp-clang-format');
gulp.task('changelog', () => {
const conventionalChangelog = require('gulp-conventional-changelog');
return gulp.src('CHANGELOG.md', {})
.pipe(conventionalChangelog({preset: 'angular', releaseCount: 1}, {
// Override release version to avoid `v` prefix for git comparison
// See https://github.com/conventional-changelog/conventional-changelog-core/issues/10
currentTag: require('./package.json').version
}))
.pipe(gulp.dest('./'));
});
gulp.task('check-format', () => {
return gulp.src(['gulpfile.js', 'misc/*.ts', 'src/**/*.ts', 'e2e-app/**/*.ts'])
.pipe(gulpFormat.checkFormat('file', clangFormat))
.on('warning', function() {
console.log('See https://github.com/nth-cloud/ng-toggle/blob/master/DEVELOPER.md#clang-format');
process.exit(1);
});
});
gulp.task('demo-push', () => {
return gulp.src('demo/dist/**/*').pipe(ghPages({branch: 'gh-pages'}));
});