mirror of
https://github.com/trezor/trezor-suite.git
synced 2026-03-06 07:25:20 +01:00
16 lines
516 B
TypeScript
16 lines
516 B
TypeScript
import { spawn } from 'child_process';
|
|
import path from 'path';
|
|
|
|
const customTorProcessDir = process.env.TOR_BINARY_PATH;
|
|
const processDir = path.join(__dirname, './../../suite-data/files/bin/tor/linux-x64/');
|
|
const processPath = customTorProcessDir || path.join(processDir, 'tor');
|
|
|
|
export const torRunner = ({ torParams = [] }: { torParams: string[] }) => {
|
|
const process = spawn(processPath, torParams, {
|
|
cwd: processDir,
|
|
stdio: ['ignore', 'ignore', 'ignore'],
|
|
});
|
|
|
|
return process;
|
|
};
|