Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

process.env['PATH'] return undefined if the system environment key [PATH] is not strictly upcased #5913

Closed
zzhengjian opened this issue May 18, 2018 · 3 comments

Comments

@zzhengjian
Copy link

Hi,

In below code, when my system environment key [PATH] is written as Path, it cause process.env['PATH'] to return undefined. Can someone please take a look?

exports.findInPath = function(file, opt_checkCwd) {
let dirs = [];
if (opt_checkCwd) {
dirs.push(process.cwd());
}
dirs.push.apply(dirs, process.env['PATH'].split(path.delimiter));

let foundInDir = dirs.find(dir => {
let tmp = path.join(dir, file);
try {
let stats = fs.statSync(tmp);
return stats.isFile() && !stats.isDirectory();
} catch (ex) {
return false;
}
});

return foundInDir ? path.join(foundInDir, file) : null;
};

image

image

https://github.com/SeleniumHQ/selenium/blob/master/javascript/node/selenium-webdriver/io/index.js

@zzhengjian
Copy link
Author

Hi,

I can access with process.env.PATH and process.env['PATH'] with node command line,
image

But still gets failed when launch selenium-webdriver, can we make this case-insensitive?

@diemol
Copy link
Member

diemol commented Mar 24, 2021

I cannot reproduce this, could you please provide a concise reproducible test case, that includes the page required to execute the scenario (a sample page or a public site).

@diemol
Copy link
Member

diemol commented Apr 16, 2021

Closing this as we did not get more information, please feel free to open a new issue if the problem still persists after trying with the most recent versions.

@diemol diemol closed this as completed Apr 16, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Sep 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants