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

Help option and lint fixes #11

Merged
merged 1 commit into from
Aug 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions bin/cli.js

This file was deleted.

33 changes: 33 additions & 0 deletions bin/tc-submission-cli.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/env node
process.env.NODE_CONFIG_DIR = `${__dirname}/../config/`

const program = require('commander')
const uploadSubmissionService = require('../src/services/uploadSubmissionService')
const logger = require('../src/common/logger')

program.on('--help', () => {
console.log(`\nTopcoder CLI to create a new submission in the challenge
with contents from current directory\n`)
console.log(`Create a file .topcoderrc in JSON format with below details
and execute command tc-submission-cli to create submission in the challenge`)
console.log(`
{
"challengeIds": [
"30095545" // at least one item here
],
"username": "TonyJ",
"password": "******"
}`)
})

program.parse(process.argv)

uploadSubmissionService.smart(process.cwd())
.then(() => {
logger.info('done!')
process.exit()
})
.catch(err => {
logger.error(err.message)
process.exit(1)
})
Loading