-
-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: convert init flag to subcommand
- Loading branch information
1 parent
569725a
commit 9594d3a
Showing
2 changed files
with
30 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { Command, flags } from '@oclif/command'; | ||
import { createRootContainer } from '../inversify.config'; | ||
import { Scanner } from '../scanner'; | ||
|
||
export default class Init extends Command { | ||
static description = 'Initialize DX Scanner configuration.'; | ||
|
||
static examples = [`$ dx-scanner init`]; | ||
|
||
static flags = { | ||
help: flags.help({ char: 'h' }), | ||
}; | ||
|
||
async run() { | ||
const scanPath = process.cwd(); | ||
|
||
const container = createRootContainer({ | ||
uri: scanPath, | ||
json: false, | ||
auth: undefined, | ||
ci: false, | ||
recursive: false, | ||
fail: 'all', | ||
}); | ||
const scanner = container.get(Scanner); | ||
|
||
await scanner.init(scanPath); | ||
process.exit(0); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters