Skip to content

Commit

Permalink
#240: fixed regression causing empty tooling options to throw an error
Browse files Browse the repository at this point in the history
  • Loading branch information
pirog committed Oct 23, 2024
1 parent 772ed2e commit 605e7df
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* Fixed bug causing https proxy routes to be assigned when they shouldnt be
* Fixed bug causing cache from repopulating old proxy addresses that have been removed [#209](https://github.com/lando/core/issues/209)
* Fixed bug in `v4` auto `entrypoint` and `command` population
* Fixed regression causing empty tooling `options` to throw an error [#240](https://github.com/lando/core/issues/240)

## v3.23.0-beta.4 - [October 22, 2024](https://github.com/lando/core/releases/tag/v3.23.0-beta.4)

Expand Down
4 changes: 4 additions & 0 deletions examples/tooling/.lando.yml
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,10 @@ tooling:
cmd: pwd
service: web
dir: /tmp
emptyopter:
cmd: pwd
service: web
options:
pwd:
cmd: pwd
service: :service
Expand Down
3 changes: 3 additions & 0 deletions examples/tooling/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,9 @@ lando everything --help | grep "lando everything \[arg1\] \[arg2\] MORETHINGS"

# Should allow for example pasthru in task definition
lando everything --help | grep "lando this is just for testing"

# Should be able to run even if options are empty
lando emptyopter
```

## Destroy tests
Expand Down
3 changes: 3 additions & 0 deletions lib/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,9 @@ module.exports = class Cli {

// Return our yarg command
return {command, describe, handler, builder: yargs => {
// ensure options is an object if it isnt
if (!_.isPlainObject(options)) options = {};

// if we have options then let is sort and add them
if (Object.keys(options).length > 0) {
for (const [option, config] of Object.entries(formatters.sortOptions(options))) {
Expand Down

0 comments on commit 605e7df

Please sign in to comment.