Skip to content

Commit 787acff

Browse files
committed
update
1 parent 3949946 commit 787acff

30 files changed

+306
-307
lines changed

.eslintignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
build/*
1+
build/*

_config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
theme: jekyll-theme-cayman
1+
theme: jekyll-theme-cayman

src/childProcessCall/cache.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*/
99

1010

11-
var path = require('path');
11+
let path = require('path');
1212

1313
import { file } from "./file";
1414

@@ -21,7 +21,7 @@ class Cache {
2121
public deleteAll() {
2222
this.list().forEach(value => {
2323
this.del(value.name);
24-
})
24+
});
2525
};
2626

2727
public get(k) {

src/childProcessCall/cli.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ import { log } from "./log";
1616
import { file } from "./file";
1717
class NewCli {
1818
constructor() {
19-
this.run()
19+
this.run();
2020
}
2121
public run() {
2222
process.stdout.on('error', function (e) {
2323
if (e.code === 'EPIPE') process.exit();
2424
});
2525
config.init();
2626
this.initLogLevel();
27-
this.initDir()
27+
this.initDir();
2828
this.initPlugins((e) => {
2929
if (e) return log.fatal(e);
3030
require('./cache').cache.init();
@@ -38,7 +38,7 @@ class NewCli {
3838

3939
private initDir() {
4040
file.init();
41-
file.mkdir(file.homeDir())
41+
file.mkdir(file.homeDir());
4242
}
4343

4444
private initPlugins(cb) {
@@ -49,9 +49,9 @@ class NewCli {
4949
}
5050

5151
private runCommand_new() {
52-
var com_str = process.argv[2]
53-
var auto_js = require("./commands/" + com_str)[com_str + "Command"]
54-
auto_js.handler(auto_js.process_argv(process.argv))
52+
let com_str = process.argv[2];
53+
let auto_js = require("./commands/" + com_str)[com_str + "Command"];
54+
auto_js.handler(auto_js.process_argv(process.argv));
5555
}
5656
}
5757

src/childProcessCall/commands/cache.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*/
99

1010

11-
var underscore = require('underscore');
11+
let underscore = require('underscore');
1212

1313

1414
import { helper } from "../helper";
@@ -21,7 +21,7 @@ class CacheCommand {
2121
}
2222

2323
process_argv = function (argv) {
24-
var argv_config = helper.base_argv().option('d', {
24+
let argv_config = helper.base_argv().option('d', {
2525
alias: 'delete',
2626
type: 'boolean',
2727
describe: 'Delete cache by keyword',
@@ -31,11 +31,11 @@ class CacheCommand {
3131
type: 'string',
3232
describe: 'Cache name or question id',
3333
default: ''
34-
})
35-
argv_config.process_argv(argv)
34+
});
35+
argv_config.process_argv(argv);
3636

37-
return argv_config.get_result()
38-
}
37+
return argv_config.get_result();
38+
};
3939

4040

4141
handler = function (argv) {

src/childProcessCall/commands/config.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
*/
99

1010

11-
var underscore = require('underscore');
12-
var nconf = require('nconf');
11+
let underscore = require('underscore');
12+
let nconf = require('nconf');
1313

1414

1515
import { config } from "../config";
@@ -25,7 +25,7 @@ class ConfigCommand {
2525

2626

2727
process_argv(argv) {
28-
var argv_config = helper.base_argv().option('a', {
28+
let argv_config = helper.base_argv().option('a', {
2929
alias: 'all',
3030
type: 'boolean',
3131
describe: 'Show all config',
@@ -46,10 +46,10 @@ class ConfigCommand {
4646
type: 'string',
4747
describe: 'Config value',
4848
default: ''
49-
})
50-
argv_config.process_argv(argv)
49+
});
50+
argv_config.process_argv(argv);
5151

52-
return argv_config.get_result()
52+
return argv_config.get_result();
5353
}
5454

5555

src/childProcessCall/commands/list.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class ListCommand {
2020
}
2121

2222
process_argv(argv) {
23-
var argv_config = helper.base_argv().option('q', corePlugin.filters.query)
23+
let argv_config = helper.base_argv().option('q', corePlugin.filters.query)
2424
.option('s', {
2525
alias: 'stat',
2626
type: 'boolean',
@@ -44,11 +44,11 @@ class ListCommand {
4444
type: 'string',
4545
default: '',
4646
describe: 'Filter questions by keyword'
47-
})
47+
});
4848

49-
argv_config.process_argv(argv)
49+
argv_config.process_argv(argv);
5050

51-
return argv_config.get_result()
51+
return argv_config.get_result();
5252
}
5353

5454
handler(argv) {
@@ -57,10 +57,10 @@ class ListCommand {
5757
if (e) return log.info(e);
5858
let new_objcet: Array<any> = [];
5959
problems.forEach(element => {
60-
let temp_ele: any = {}
60+
let temp_ele: any = {};
6161
for (const key in element) {
6262
if (key != "link") {
63-
temp_ele[key] = element[key]
63+
temp_ele[key] = element[key];
6464
}
6565
}
6666
new_objcet.push(temp_ele);

src/childProcessCall/commands/plugin.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class PluginCommand {
2121
}
2222

2323
process_argv = function (argv) {
24-
var argv_config = helper.base_argv().option('d', {
24+
let argv_config = helper.base_argv().option('d', {
2525
alias: 'disable',
2626
type: 'boolean',
2727
describe: 'Disable plugin',
@@ -40,12 +40,12 @@ class PluginCommand {
4040
type: 'string',
4141
describe: 'Filter plugin by name',
4242
default: ''
43-
})
43+
});
4444

45-
argv_config.process_argv(argv)
45+
argv_config.process_argv(argv);
4646

47-
return argv_config.get_result()
48-
}
47+
return argv_config.get_result();
48+
};
4949

5050
handler = function (argv) {
5151
session.argv = argv;
@@ -83,7 +83,6 @@ class PluginCommand {
8383
myPluginBase.init();
8484
} else if (argv.config) {
8585
log.info(JSON.stringify(config.plugins[name] || {}, null, 2));
86-
} else {
8786
}
8887
};
8988
}

src/childProcessCall/commands/query.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class QueryCommand {
2020

2121

2222
process_argv = function (argv) {
23-
var argv_config = helper.base_argv().option('T', {
23+
let argv_config = helper.base_argv().option('T', {
2424
alias: 'dontTranslate',
2525
type: 'boolean',
2626
default: false,
@@ -42,12 +42,12 @@ class QueryCommand {
4242
type: 'string',
4343
default: "",
4444
describe: 'test',
45-
})
45+
});
4646

47-
argv_config.process_argv(argv)
47+
argv_config.process_argv(argv);
4848

49-
return argv_config.get_result()
50-
}
49+
return argv_config.get_result();
50+
};
5151

5252
handler = function (argv) {
5353
session.argv = argv;

src/childProcessCall/commands/session.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class SessionCommand {
5353
if (argv.create)
5454
return corePlugin.createSession(argv.keyword, this.printSessions);
5555

56-
var that = this;
56+
let that = this;
5757
corePlugin.getSessions(function (e, sessions) {
5858
if (e) return log.info(e);
5959

src/childProcessCall/commands/show.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
*/
99

1010

11-
var util = require('util');
12-
var childProcess = require('child_process');
11+
let util = require('util');
12+
let childProcess = require('child_process');
1313

1414

1515
import { helper } from "../helper";
@@ -27,7 +27,7 @@ class ShowCommand {
2727

2828

2929
process_argv = function (argv) {
30-
var argv_config = helper.base_argv().option('c', {
30+
let argv_config = helper.base_argv().option('c', {
3131
alias: 'codeonly',
3232
type: 'boolean',
3333
default: false,
@@ -75,13 +75,13 @@ class ShowCommand {
7575
type: 'string',
7676
default: '',
7777
describe: 'Show question by name or id'
78-
})
78+
});
7979

8080

81-
argv_config.process_argv(argv)
81+
argv_config.process_argv(argv);
8282

83-
return argv_config.get_result()
84-
}
83+
return argv_config.get_result();
84+
};
8585

8686

8787
genFileName(problem, opts) {
@@ -174,7 +174,7 @@ class ShowCommand {
174174
if (problem.totalSubmit)
175175
log.info(`* Total Submissions: ${problem.totalSubmit}`);
176176
if (problem.testable && problem.testcase) {
177-
var testcase_value = util.inspect(problem.testcase)
177+
let testcase_value = util.inspect(problem.testcase);
178178
log.info(`* Testcase Example: ${testcase_value}`);
179179
}
180180
if (filename)
@@ -185,7 +185,7 @@ class ShowCommand {
185185
}
186186

187187
handler(argv) {
188-
var that = this
188+
let that = this;
189189
session.argv = argv;
190190
if (argv.keyword.length > 0) {
191191
// show specific one

src/childProcessCall/commands/star.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class StarCommand {
2020
}
2121

2222
process_argv(argv) {
23-
var argv_config = helper.base_argv().option('d', {
23+
let argv_config = helper.base_argv().option('d', {
2424
alias: 'delete',
2525
type: 'boolean',
2626
describe: 'Unstar question',
@@ -30,12 +30,12 @@ class StarCommand {
3030
type: 'string',
3131
describe: 'Question name or id',
3232
default: ''
33-
})
33+
});
3434

3535

36-
argv_config.process_argv(argv)
36+
argv_config.process_argv(argv);
3737

38-
return argv_config.get_result()
38+
return argv_config.get_result();
3939
}
4040

4141
handler(argv) {

src/childProcessCall/commands/stat.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
*/
99

1010

11-
var moment_out = require('moment');
12-
var underscore = require('underscore');
11+
let moment_out = require('moment');
12+
let underscore = require('underscore');
1313

1414
import { helper } from "../helper";
1515
import { log } from "../log";
@@ -22,7 +22,7 @@ class StatCommand {
2222
}
2323

2424
process_argv(argv) {
25-
var argv_config = helper.base_argv().option('c', {
25+
let argv_config = helper.base_argv().option('c', {
2626
alias: 'cal',
2727
type: 'boolean',
2828
default: false,
@@ -41,10 +41,10 @@ class StatCommand {
4141
describe: 'Include locked questions'
4242
})
4343
.option('q', corePlugin.filters.query)
44-
.option('t', corePlugin.filters.tag)
45-
argv_config.process_argv(argv)
44+
.option('t', corePlugin.filters.tag);
45+
argv_config.process_argv(argv);
4646

47-
return argv_config.get_result()
47+
return argv_config.get_result();
4848
}
4949

5050
printLine(key, done, all) {
@@ -200,7 +200,7 @@ class StatCommand {
200200

201201
handler(argv) {
202202
session.argv = argv;
203-
var that = this;
203+
let that = this;
204204
corePlugin.filterProblems(argv, function (e, problems) {
205205
if (e) return log.info(e);
206206

0 commit comments

Comments
 (0)