Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 914d579

Browse files
Merge pull request #11 from sharathkumaranbu/Issue_4
Help option and lint fixes
2 parents 2ffc76e + aec83e9 commit 914d579

File tree

7 files changed

+1319
-112
lines changed

7 files changed

+1319
-112
lines changed

bin/cli.js

Lines changed: 0 additions & 15 deletions
This file was deleted.

bin/tc-submission-cli.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/usr/bin/env node
2+
process.env.NODE_CONFIG_DIR = `${__dirname}/../config/`
3+
4+
const program = require('commander')
5+
const uploadSubmissionService = require('../src/services/uploadSubmissionService')
6+
const logger = require('../src/common/logger')
7+
8+
program.on('--help', () => {
9+
console.log(`\nTopcoder CLI to create a new submission in the challenge
10+
with contents from current directory\n`)
11+
console.log(`Create a file .topcoderrc in JSON format with below details
12+
and execute command tc-submission-cli to create submission in the challenge`)
13+
console.log(`
14+
{
15+
"challengeIds": [
16+
"30095545" // at least one item here
17+
],
18+
"username": "TonyJ",
19+
"password": "******"
20+
}`)
21+
})
22+
23+
program.parse(process.argv)
24+
25+
uploadSubmissionService.smart(process.cwd())
26+
.then(() => {
27+
logger.info('done!')
28+
process.exit()
29+
})
30+
.catch(err => {
31+
logger.error(err.message)
32+
process.exit(1)
33+
})

0 commit comments

Comments
 (0)