Skip to content

Commit

Permalink
fixed lando update so it removes lingering lando.exes in the update b…
Browse files Browse the repository at this point in the history
…in directory
  • Loading branch information
pirog committed Nov 21, 2024
1 parent 25c7852 commit fcbe7a3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
## {{ UNRELEASED_VERSION }} - [{{ UNRELEASED_DATE }}]({{ UNRELEASED_LINK }})

* Fixed `lando shellenv` failing when shell profile is empty
* Fixed `lando shellenv` to always include `~/.lando/bin` and include it first
* Fixed `lando shellenv` so it doesn't fail when `shell` profile is empty
* Fixed `lando update` so it removes lingering `lando.exe`s in the update bin directory
* Improved `lando shellenv` so that it always includes `~/.lando/bin` and includes it first
* Improved messaging on `lando shellenv --add`

## v3.23.11 - [November 20, 2024](https://github.com/lando/core/releases/tag/v3.23.11)
Expand Down
9 changes: 8 additions & 1 deletion lib/updates.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const get = require('lodash/get');
const getOctokit = require('../utils/get-octokit');
const os = require('os');
const path = require('path');
const remove = require('../utils/remove');
const semver = require('semver');
const uniqBy = require('lodash/uniqBy');

Expand Down Expand Up @@ -249,7 +250,13 @@ module.exports = class UpdateManager {
// refresh the "symlink"
require('../utils/link-bin')(this._cli.installPath, dest, {debug: this.debug});

// is link is not in PATH then attempt to add it
// if lando.exe exists on windows in the install path then remove it so the link has primacy
// in PATHEXT hierarchy
if (process.platform === 'win32' && fs.existsSync(path.join(this._cli.installPath, filename))) {
remove(path.join(this._cli.installPath, filename));
}

// if link is not in PATH then attempt to add it
// @NOTE: feels sufficient to just check for `lando` since it _should_ exist in win and posix
if (!require('../utils/is-in-path')(path.join(this._cli.installPath, 'lando'))) {
const binPaths = require('../utils/get-bin-paths')(this._cli);
Expand Down

0 comments on commit fcbe7a3

Please sign in to comment.