1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 11:22:43 +02:00

don't run subprocesses in lavamoat if main process not run in lavamoat (#11417)

This commit is contained in:
Etienne Dusseault 2021-06-30 12:37:03 +08:00 committed by GitHub
parent 8f371e4f87
commit b9cf309404
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -68,9 +68,20 @@ function runInChildProcess(task) {
);
}
return instrumentForTaskStats(taskName, async () => {
const childProcess = spawn('yarn', ['build', taskName, '--skip-stats'], {
env: process.env,
});
let childProcess;
// don't run subprocesses in lavamoat for dev mode if main process not run in lavamoat
if (
taskName.includes('scripts:core:dev') &&
!process.argv[0].includes('lavamoat')
) {
childProcess = spawn('yarn', ['build:dev', taskName, '--skip-stats'], {
env: process.env,
});
} else {
childProcess = spawn('yarn', ['build', taskName, '--skip-stats'], {
env: process.env,
});
}
// forward logs to main process
// skip the first stdout event (announcing the process command)
childProcess.stdout.once('data', () => {