@infosupport/huddle-cli 0.0.0-experiment-160.98.1 → 0.0.0-experiment-160.100.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/pipe/tools.js +14 -15
  2. package/package.json +1 -1
@@ -61,22 +61,21 @@ function resolveTool(name) {
61
61
  const bins = override ? [override] : spec.bins;
62
62
  const dirs = (process.env.PATH ?? '').split(path_1.default.delimiter).filter(Boolean);
63
63
  let refused;
64
- for (const bin of bins) {
65
- // A bin with a directory in it is a path, not a name to look up on PATH.
66
- const lookups = bin.includes('/') || bin.includes('\\') ? [path_1.default.resolve(bin)] : dirs.map((d) => path_1.default.join(d, bin));
67
- for (const lookup of lookups) {
68
- for (const file of candidates(lookup)) {
69
- const ext = path_1.default.extname(file).toLowerCase();
70
- // On Windows, skip batch files (they go through cmd.exe) and non-executables.
71
- if (process.platform === 'win32' && !WIN_RUNNABLE_EXT.has(ext)) {
72
- if (REFUSED_EXT.has(ext) && isRunnableFile(file))
73
- refused ??= file;
74
- continue;
75
- }
76
- if (isRunnableFile(file))
77
- return { path: file };
78
- }
64
+ // Every file to try, in order. A bin with a directory in it is a path, not a
65
+ // name to look up on PATH.
66
+ const files = bins
67
+ .flatMap((bin) => (bin.includes('/') || bin.includes('\\') ? [path_1.default.resolve(bin)] : dirs.map((d) => path_1.default.join(d, bin))))
68
+ .flatMap(candidates);
69
+ for (const file of files) {
70
+ const ext = path_1.default.extname(file).toLowerCase();
71
+ // On Windows, skip batch files (they go through cmd.exe) and non-executables.
72
+ if (process.platform === 'win32' && !WIN_RUNNABLE_EXT.has(ext)) {
73
+ if (REFUSED_EXT.has(ext) && isRunnableFile(file))
74
+ refused ??= file;
75
+ continue;
79
76
  }
77
+ if (isRunnableFile(file))
78
+ return { path: file };
80
79
  }
81
80
  if (refused) {
82
81
  return { error: new protocol_1.PipeError('not_allowed', `refusing to run ${refused}: batch files go through cmd.exe`) };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infosupport/huddle-cli",
3
- "version": "0.0.0-experiment-160.98.1",
3
+ "version": "0.0.0-experiment-160.100.1",
4
4
  "description": "Huddle CLI — start devcontainers and manage firewall rules",
5
5
  "license": "GPL-3.0-or-later",
6
6
  "author": "Info Support B.V.",