Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Regression from #465. Before: ``` ❯ ../bin/elm-test install truqu/elm-md5 I am having trouble with this argument: t It is supposed to be a <package> value, like one of these: elm/html elm/http elm/svg elm/time ``` After: ``` ❯ ../bin/elm-test install truqu/elm-md5 Here is my plan: Add: truqu/elm-md5 1.1.0 zwilias/elm-utf-tools 2.0.1 Would you like me to update your elm.json accordingly? [Y/n]: Success! ``` This happened because I thought the first argument of the `.action` callback is always an array. Wrong! The signature depends on the `.command` syntax provided: ```js program .command('name <one> <two> [three] [rest...]') .action((one: string, two: string, three: string | undefined, rest: Array<string>, cmd: Command) => { // Do stuff }); ``` For the install command we have: ```js program .command('install <package>') .action((packageName: string, cmd: Command) => {}) ``` Before we tried to destructure the first argument (thinking it was an array), so we only got the first letter of the package name. Unfortunately our test suite doesn’t catch this.
- Loading branch information