-
Notifications
You must be signed in to change notification settings - Fork 52
/
Gruntfile.js
48 lines (44 loc) · 1.5 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
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
clean: ["tmp", "dist"],
copy: {
main: {
expand: true,
src: ['global.json', 'global-forms.json', 'CHANGELOG.md'],
dest: 'tmp/'}
},
compress: {
main: {
options: {
archive: 'dist/fh-template-apps-<%= pkg.version %>.tar.gz',
mode: 'tgz'
},
expand: true,
cwd: 'tmp/',
src: ['**/*', '**/.*']
}
},
clone: ["global.json", 'global-forms.json'],
tag: ["global.json", 'global-forms.json'],
branch: ["global.json", 'global-forms.json'],
push: ["global.json", 'global-forms.json'],
gitrefs: ["global.json", 'global-forms.json'],
download: ["tmp/global.json", 'tmp/global-forms.json'],
format: ["global.json", 'global-forms.json']
});
grunt.loadNpmTasks('grunt-git');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-compress');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-curl');
grunt.loadTasks('tasks');
grunt.registerMultiTask('format', 'Correctly format json config files', function () {
this.filesSrc.forEach(function (filepath) {
var globalJson = grunt.file.readJSON(filepath);
grunt.file.write(filepath, JSON.stringify(globalJson, null, ' ') + '\n');
});
});
grunt.registerTask('archive', ['clean', 'copy', 'clone', 'download', 'compress']);
grunt.registerTask('default', ['archive']);
};