forked from feedhenry/fh-template-apps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
45 lines (40 loc) · 1.31 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
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: ["tmp/global.json", 'tmp/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, ' '));
});
});
grunt.registerTask('archive', ['clean', 'copy', 'clone', 'download', 'compress']);
grunt.registerTask('default', ['archive']);
};