import { parseEnv } from 'node:util';
import { readFile, writeFile } from 'node:fs/promises';
-import { execSync } from 'node:child_process';
+import childProcess from 'node:child_process';
/** @import { PathLike } from 'node:fs'; */
import { getPrf } from '#src/getPrf.js';
}
if (args.length > 0) {
logger.debug?.('Follow-on command found, executing in child process.');
- execSync(args.join(' '), { stdio: 'inherit' });
+ childProcess.execSync(args.join(' '), { stdio: 'inherit' });
}
}
\ No newline at end of file
import { suite, test } from 'node:test';
import { deepStrictEqual } from 'node:assert';
+import childProcess from 'node:child_process';
import { encrypt, decrypt } from '#src/index.js';
import { BROWSER } from '#src/getPrf.js';
await fileEqual(envFile, env);
deepStrictEqual(openMock.mock.calls.length, 0);
});
+ test('decrypt passes through excess args to execute', async (t) => {
+ const execMock = t.mock.method(childProcess, 'execSync', () => { });
+ const envFile = await setupEnv(t, STD_ENV);
+
+ await decrypt({ inFile: envFile }, { args: ['test', 'test', 'test'] });
+ deepStrictEqual(execMock.mock.calls.length, 1);
+ });
});