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

Accepts options as CLI arguments in create-fuels #1732

Closed
arboleya opened this issue Feb 9, 2024 · 0 comments · Fixed by #1777
Closed

Accepts options as CLI arguments in create-fuels #1732

arboleya opened this issue Feb 9, 2024 · 0 comments · Fixed by #1777
Assignees
Labels
feat Issue is a feature

Comments

@arboleya
Copy link
Member

arboleya commented Feb 9, 2024

Example:

# usage
npm create fuels <destination|name> [options]

# explicitly
npm create fuels my-dapp --contract --script --pnpm

# shortcuts
npm create fuels my-dapp -cs --pnpm

This should be simple by validating and grabbing the argv:

program.option('-D, --debug', 'Enables verbose logging', false);
program.option('-S, --silent', 'Omit output messages', false);

And then skipping the prompts accordingly:

// pseudo
async function promptForProjectPath() {
  return program.projectName ?? (await prompts({
    type: 'text',
    name: 'projectName',
    message: 'What is the name of your project?',
    initial: 'my-fuel-project',
  })).projectName as string;
}

Originally posted by @arboleya in #1691 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat Issue is a feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants