Skip to content

Commit

Permalink
#259: added helpful warning if cli update location is not in PATH
Browse files Browse the repository at this point in the history
  • Loading branch information
pirog committed Oct 29, 2024
1 parent b5c275e commit 5440f38
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
## {{ UNRELEASED_VERSION }} - [{{ UNRELEASED_DATE }}]({{ UNRELEASED_LINK }})

### New Features & Improvements

* Added useful `warning` if Lando cannot detect the CLI update location in `PATH` [#259](https://github.com/lando/core/issues/259)

### Fixed

* Fixed regression causing some recipe `tooling` commands to _disappear_ in apps with characters in their `name` that get altered by `slugification`

## v3.23.0 - [October 26, 2024](https://github.com/lando/core/releases/tag/v3.23.0)
Expand Down
24 changes: 20 additions & 4 deletions hooks/app-add-path-info.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,25 @@
'use strict';

const {color} = require('listr2');

const {bold} = color;

module.exports = async (app, lando) => {
// push a message if the install path is not in the bin
// snag cli config
const config = lando?.config?.cli;

// console.log(lando.config.cli)
// console.log(require('../utils/get-bin-paths')(lando?.config?.cli))
// process.exit(1)
// push a message if the install path is not in the bin or is
if (config?.installPath && require('../utils/get-bin-paths')(config).includes(config.installPath)) {
app.addMessage({
title: 'Lando update location not in PATH!',
type: 'warning',
detail: [
`Lando cannot detect ${bold(config.installPath)} in ${bold('PATH')}!`,
'This can prevent the CLI from updating correctly which in turn can',
`cause other strange behavior like commands ${bold('disappearing')}.`,
`We recommend you run the command below and ${bold('DO WHAT IT SAYS.')}`,
],
command: 'lando shellenv --add',
});
};
};

0 comments on commit 5440f38

Please sign in to comment.