-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGruntFile.js
More file actions
44 lines (38 loc) · 1.28 KB
/
Copy pathGruntFile.js
File metadata and controls
44 lines (38 loc) · 1.28 KB
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
const fs = require('fs');
module.exports = (grunt) => {
grunt.initConfig({
eslint: {
lib: {
"src": ["lib/**/*.js"]
}
}
});
// Set up the linter task
grunt.loadNpmTasks('gruntify-eslint');
grunt.registerTask('lint', ['eslint']);
// Creates the JSON required by the DB interface
grunt.registerTask('createDbConfig', () => {
fs.openSync('./mongodbConfig.json', 'w');
let dbConf = {
user: grunt.option('user'),
pass: grunt.option('pass'),
hosts: grunt.option('hosts'),
opts: grunt.option('opts').split(',').join('&')
};
fs.writeFileSync('./mongodbConfig.json', JSON.stringify(dbConf),
{encoding: 'utf8', flag: 'w'});
});
// Creates a JSON containing the Giant Bomb API Key
grunt.registerTask('addGiantBombApiKey', () => {
fs.openSync('./giantBomb.json', 'w');
let bombConf = {
key: grunt.option('key')
};
fs.writeFileSync('./giantBomb.json', JSON.stringify(bombConf),
{encoding: 'utf8', flag: 'w'});
});
// Creates a JSON containing the Giant Bomb API Key
grunt.registerTask('createLogFile', () => {
fs.openSync('./app.log', 'w');
});
};