Skip to content

Commit

Permalink
recipe related fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pirog committed Sep 5, 2024
1 parent a76567f commit a1b0f2b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
## {{ UNRELEASED_VERSION }} - [{{ UNRELEASED_DATE }}]({{ UNRELEASED_LINK }})

## Bug Fixes

* Fixed bug causing preexisting `urls` in `lando info` to be clobbered by `localhost` port discovery
* Fixed bug causing `allServices` to sometimes be unset in some recipe tasks

## v3.22.0-beta.6 - [September 4, 2024](https://github.com/lando/core/releases/tag/v3.22.0-beta.6)

* This release contains only tests and is mostly to keep version sync with the CLI
Expand Down
12 changes: 11 additions & 1 deletion hooks/app-find-localhosts.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,15 @@ module.exports = async (app, lando) => {
getHttpsPorts(data),
lando.config.bindAddress,
))
.map(data => _.find(app.info, {service: data.service}).urls = data.urls);
// add data to existing info
.map(data => {
// get info
const info = _.find(app.info, {service: data.service});
// remove existing localhosts because they are probably stale
_.remove(info.urls, url => url.startsWith('http://localhost'));
_.remove(info.urls, url => url.startsWith('https://localhost'));
// and then reset
info.urls = _.uniq([...info.urls, ...data.urls]);
});
;
};
2 changes: 1 addition & 1 deletion tasks/exec.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ module.exports = (lando, config = lando.appConfig) => ({
}

// nice things
const aservices = app.config.allServices ?? [];
const aservices = app?.config?.allServices ?? app?.allServices ?? [];
const choices = `[${color.green('choices:')} ${aservices.map(service => `"${service}"`).join(', ')}]`;

// gather our options
Expand Down

0 comments on commit a1b0f2b

Please sign in to comment.