forked from sbedulin/pro-angularjs-book
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
50 lines (46 loc) · 1.37 KB
/
Gruntfile.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
module.exports = function(grunt) {
grunt.initConfig({
replace: {
readme: {
src: ['README.md'],
overwrite: true,
replacements: [{
from: 'app',
to: 'project'
}]
}
},
shell: {
gitAdd: {
command: 'git add README.md'
},
gitCommit: {
command: "git commit README.md -m 'Updated readme'"
}
},
jshint: {
files: [
'app/chapter-19/*.js' // Only apply tests to angular scripts for now
],
options: {
jshintrc: true
}
},
copy: {
"jshint-pre-commit-hook": {
src: '.jshint-pre-commit-hook',
dest: '.git/hooks/pre-commit'
}
}
});
grunt.loadNpmTasks('grunt-git');
grunt.loadNpmTasks('grunt-text-replace');
grunt.loadNpmTasks('grunt-shell');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.registerTask('default', function() {
grunt.task.run('replace', 'shell:gitAdd', 'shell:gitCommit');
});
grunt.registerTask('validatejs', ['jshint']);
grunt.registerTask('jshint-hook', ['copy:jshint-pre-commit-hook']);
};