Skip to content

Commit

Permalink
simplify usage of lando shellenv --add
Browse files Browse the repository at this point in the history
  • Loading branch information
pirog committed Nov 21, 2024
1 parent 0ebe7cd commit 25c7852
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions utils/get-bin-paths.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
const fs = require('fs');
const path = require('path');

module.exports = ({entrypoint, file, installPath}) => {
return [installPath, entrypoint, file]
module.exports = ({installPath}) => {
return [installPath]
.filter(p => typeof p === 'string' && p !== '' && fs.existsSync(p))
.map(p => !fs.lstatSync(p).isDirectory() ? path.dirname(p) : p)
.filter(p => !process.env.PATH.split(path.delimiter).includes(p) || p === installPath)
.filter(p => !process.env.PATH.split(path.delimiter).includes(p))
.filter((v, i, self) => i === self.indexOf(v));
};

0 comments on commit 25c7852

Please sign in to comment.