mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-04-15 22:43:28 +08:00
test: fix harness audit env fallback
This commit is contained in:
@@ -20,13 +20,20 @@ function cleanup(dirPath) {
|
|||||||
|
|
||||||
function run(args = [], options = {}) {
|
function run(args = [], options = {}) {
|
||||||
const userProfile = options.userProfile || options.homeDir || process.env.USERPROFILE;
|
const userProfile = options.userProfile || options.homeDir || process.env.USERPROFILE;
|
||||||
|
const env = {
|
||||||
|
...process.env,
|
||||||
|
USERPROFILE: userProfile,
|
||||||
|
};
|
||||||
|
|
||||||
|
if (Object.prototype.hasOwnProperty.call(options, 'homeDir')) {
|
||||||
|
env.HOME = options.homeDir;
|
||||||
|
} else {
|
||||||
|
env.HOME = process.env.HOME;
|
||||||
|
}
|
||||||
|
|
||||||
const stdout = execFileSync('node', [SCRIPT, ...args], {
|
const stdout = execFileSync('node', [SCRIPT, ...args], {
|
||||||
cwd: options.cwd || path.join(__dirname, '..', '..'),
|
cwd: options.cwd || path.join(__dirname, '..', '..'),
|
||||||
env: {
|
env,
|
||||||
...process.env,
|
|
||||||
HOME: options.homeDir || process.env.HOME,
|
|
||||||
USERPROFILE: userProfile,
|
|
||||||
},
|
|
||||||
encoding: 'utf8',
|
encoding: 'utf8',
|
||||||
stdio: ['pipe', 'pipe', 'pipe'],
|
stdio: ['pipe', 'pipe', 'pipe'],
|
||||||
timeout: 10000,
|
timeout: 10000,
|
||||||
|
|||||||
Reference in New Issue
Block a user