2017-05-28 00:38:50 +02:00
|
|
|
'use strict';
|
2017-08-14 05:01:11 +02:00
|
|
|
module.exports = opts => {
|
2017-05-28 00:38:50 +02:00
|
|
|
opts = opts || {};
|
|
|
|
|
2017-08-14 05:01:11 +02:00
|
|
|
const env = opts.env || process.env;
|
|
|
|
const platform = opts.platform || process.platform;
|
2017-05-28 00:38:50 +02:00
|
|
|
|
|
|
|
if (platform !== 'win32') {
|
|
|
|
return 'PATH';
|
|
|
|
}
|
|
|
|
|
2017-08-14 05:01:11 +02:00
|
|
|
return Object.keys(env).find(x => x.toUpperCase() === 'PATH') || 'Path';
|
2017-05-28 00:38:50 +02:00
|
|
|
};
|