Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(create-robo): --no-creds option #246

Merged
merged 4 commits into from
May 31, 2024
Merged
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
10 changes: 8 additions & 2 deletions packages/create-robo/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export interface CommandOptions {
verbose?: boolean
roboVersion?: string
update?: boolean
noCreds?: boolean
}

new Command('create-robo <projectName>')
Expand All @@ -40,6 +41,7 @@ new Command('create-robo <projectName>')
.option('-v --verbose', 'print more information for debugging')
.option('-rv, --robo-version <value>', 'specify a Robo.js version to use')
.option('-k, --kit <value>', 'choose a kit to start off with your Robo')
.option('-nc, --no-creds', 'Skips asking for the credentials')
.action(async (options: CommandOptions, { args }) => {
logger({
level: options.verbose ? 'debug' : 'info'
Expand Down Expand Up @@ -156,11 +158,15 @@ new Command('create-robo <projectName>')
}

// Want some plugins?
await robo.plugins()
// if there are plugins specified with the command we skip asking for more.
if (options.plugins === undefined || options.plugins.length <= 0) {
await robo.plugins()
}

// Ask the user for their Discord credentials (token and client ID) and store them for later use
// Skip this step if the user is creating a plugin
if (!robo.isPlugin) {
//
if (!robo.isPlugin && options.noCreds) {
logger.debug(`Asking for Discord credentials...`)
await robo.askForDiscordCredentials()
}
Expand Down
Loading