saojs / sao

⚔ Futuristic scaffolding tool
https://sao.vercel.app
MIT License
1.05k stars 61 forks source link

sao <command> [options] is wrong #93

Open Piterden opened 6 years ago

Piterden commented 6 years ago

I trying to scaffold a new project. The usage is sao <command> [options].

$ sao -u --force-npm piterden/template-bot test-tpl-bot
> Installing template-test-tpl-bot with npm...
error Error occurs during installing package:
npm ERR! code E404
npm ERR! 404 Not Found: template-test-tpl-bot@latest

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/den/.npm/_logs/2018-04-24T03_49_44_989Z-debug.log
$ sao -u --force-npm piterden/template-bot 

  sao 0.22.17

  Futuristic project generator.

  USAGE

    sao <command> [options]

  COMMANDS

    *  Generate a new project

  COMMAND OPTIONS

    --config                  Use custom config file
    --install                 Same as --update (deprecated)
    -u, --update              Update cached template before generating                                [Type: boolean]
    -y, --yes, --mockPrompts  Skip prompt and use default values
    --remove-store            Remove stored prompt answers                                            [Type: boolean]
    --skip-store              Skip stored prompt answers, i.e. do not use them                        [Type: boolean]
    --templates               Show installed templates                                                [Type: boolean]
    --force-npm               Always use npm^5 instead of yarn to install templates and dependencies
    --clone                   Use git clone instead of an http download                               [Type: boolean]
    --update-notify           Show notifier when relevant template has updates                        [Default: true]

  GLOBAL OPTIONS

    -v, --version  Display version                     [Type: boolean]
    -h, --help     Display help (You're already here)  [Type: boolean]

Here is the right solution:

$ sao piterden/template-bot test-tpl-bot -u --force-npm

It seems --force-npm waits for a value...

egoist commented 6 years ago

Yep we should add a type: 'boolean' here https://github.com/saojs/sao/blob/5bc53d415d9b19b7ee437a0e2e5cc12915ee9fd3/bin/sao#L122-L124

Piterden commented 6 years ago

I will, just a moment...