You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have two path entries 'D:....' but whichSync failed to iterate over pathEnv beyond these when trying to find the 'git' path. I changed the order so the 'D:...' entries were last and whichSync parsed everything up to but not including those moved 'D:...' entries. When moved, there were the 14th and 15th path entries.
Didn't work:
Worked:
The text was updated successfully, but these errors were encountered:
@johnkazer Just out of curiosity, what's the output you get if you run the following script?
node that-script-below.js
"use strict";which("git").then(output=>{console.log(output);});/** * Locate a program file in the user's $PATH. * * If found, the returned {@link Promise} resolves to the absolute * pathname of the named executable. Otherwise, it resolves to the * empty string. Rejects with an error if the execution failed. * * @example which("curl") == "/usr/bin/curl" * @example which("nada") == "" * @param {String} name * @return {Promise} */functionwhich(name){returnnewPromise((resolve,reject)=>{if(!name)returnresolve("");const{exec}=require("child_process");constcmdStr="win32"===process.platform
? `@for %g in (ECHO ${name.replace(/%/g,"%%")}) do`+" @for %e in (%PATHEXT%) do"+" @for %i in (%g%e) do "+' @if NOT "%~$PATH:i"=="" echo %~$PATH:i'
: `command -v '${name.replace(/'/g,`'"'"'`)}' 2>/dev/null`;exec(cmdStr,{windowsHide: true},(error,output)=>error
? reject(error)
: resolve(output.split(/\r?\n/).filter(Boolean)[0]||""));});}
I have two path entries 'D:....' but whichSync failed to iterate over pathEnv beyond these when trying to find the 'git' path. I changed the order so the 'D:...' entries were last and whichSync parsed everything up to but not including those moved 'D:...' entries. When moved, there were the 14th and 15th path entries.
Didn't work:
Worked:
The text was updated successfully, but these errors were encountered: