This repository has been archived by the owner on Feb 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathGruntfile.js
48 lines (38 loc) · 1.56 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) {
global.repo_info = {
origin: '[email protected]:binary-com/binary-mt.git',
CNAME : 'mt.binary.com'
};
// map release parameters to required branch and target gh-pages subfolder
global.release_info = {
production : {branch: 'master', target_folder: ''},
beta : {branch: 'beta' , target_folder: 'beta'},
translations: {branch: 'beta' , target_folder: 'translations'},
};
Object.keys(global.release_info).forEach(function(target) {
if (grunt.option(target)) {
global.release_target = target;
}
});
if (global.release_target) {
global.branch_prefix = '';
global.branch = global.release_info[global.release_target].target_folder;
} else {
global.branch_prefix = 'br_';
global.branch = grunt.option('branch');
}
global.dist = 'dist' + (global.branch ? '/' + global.branch_prefix + global.branch : '');
global.path = grunt.option('path');
global.compileCommand = function(params) {
return 'cd ' + process.cwd() + '/scripts && carton exec perl compile.pl ' + params + (global.branch ? ' -b ' + global.branch_prefix + global.branch : '') + (global.path ? ' -p ' + global.path : '') + ' && cd ..';
};
require('time-grunt')(grunt);
require('load-grunt-config')(grunt, {
configPath: process.cwd() + '/build',
loadGruntTasks: {
pattern: 'grunt-*',
config: require('./package.json'),
scope: 'devDependencies'
}
});
};