forked from crowbartools/Firebot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
62 lines (48 loc) · 1.94 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
51
52
53
54
55
56
57
58
59
60
61
62
/*
All registered tasks accept a platform flag to override the default os platform
Example: grunt pack --platform=linux
Registered Tasks:
setup - runs npm install, npm rebuild, and rebuild for robotjs
cleanup - Deletes compiled CSS, and empties /dist/
cleanup:css - Deletes compiled CSS
cleanup:pack - Deletes /dist/pack
cleanup:install - Deletes /dist/install
cleanup:dist - Empties /dist/
scss - Deletes compiled CSS, then recompiles SCSS
lint - Runs eslint
secrets:encrypt - Encrypts an updated secrets.json to secrets.gpg
secrets:decrypt - Decrypts the repo's secrets.gpg to secrects.json
pack
- Runs electron-packager for the platform
- Copies resources into the pack's resource folder
compile - Creates an installer/tarball from the platform's pack
build - Runs cleanup, scss, pack, and compile
*/
module.exports = function(grunt) {
// Deduce platform
let platform = grunt.option('platform');
if (platform == null || platform == '' || platform instanceof Boolean) {
platform = process.platform === 'win32' ? 'win64' : process.platform;
}
if (platform !== 'win64' && platform !== 'linux') {
//grunt.fail.fatal(new Error('Platform not supported'), 1);
}
// Base configuration
grunt.initConfig({
platform: platform,
pkg: grunt.file.readJSON('package.json'),
});
// Register shell executor
grunt.loadNpmTasks('grunt-shell');
// Register project modules
require('./grunt/cleanup.js')(grunt);
require('./grunt/scss.js')(grunt);
require('./grunt/lint.js')(grunt);
require('./grunt/copy.js')(grunt);
require('./grunt/pack.js')(grunt);
require('./grunt/compile.js')(grunt);
require('./grunt/setup.js')(grunt);
require('./grunt/secrets.js')(grunt);
require('./grunt/include-source')(grunt);
grunt.registerTask('build', ['scss', 'include-source', 'pack', 'compile']);
};