-
Notifications
You must be signed in to change notification settings - Fork 5
/
show-module.js
33 lines (29 loc) · 1.2 KB
/
show-module.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
module.exports = function (arg) {
switch (arg) {
case 'gist':
var pkg = require('./package.json');
var Configstore = require('configstore');
var conf = new Configstore(pkg.name);
var clc = require('cli-color');
if (conf.size < 2) {
console.log('You have not authenticated yet.');
console.log('Please run ' + clc.green('solve login') + ' before running ' + clc.red('solve push'));
} else if (conf.get('gist_id') && conf.get('username')) {
console.log('Visit this URL for your solve history: ');
console.log('https://gist.github.com/' + conf.get('username') + '/' + conf.get('gist_id'));
} else {
console.log("You are authenticated, but we don't have a Gist ID.");
console.log('Log a few solves, and then run ' + clc.green('solve push') + ' to get a Gist ID.');
}
break;
case 'local':
console.log('Local file path: ');
console.log(require('./file-module.js').checkLocalFile());
break;
default:
console.log('Unknown option!');
console.log('For recognised options, check the README file here:');
console.log('http://github.com/icyflame/node-cube-cli-timer');
break;
}
};