Skip to content

Commit

Permalink
style: importing child_process as childProcess
Browse files Browse the repository at this point in the history
  • Loading branch information
emmacasolin committed Aug 9, 2022
1 parent 8815b7e commit 0ee0b89
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/bin/agent/CommandStart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import type PolykeyAgent from '../../PolykeyAgent';
import type { RecoveryCode } from '../../keys/types';
import type { PolykeyWorkerManagerInterface } from '../../workers/types';
import path from 'path';
import child_process from 'child_process';
import childProcess from 'child_process';
import process from 'process';
import CommandPolykey from '../CommandPolykey';
import * as binUtils from '../utils';
Expand Down Expand Up @@ -130,7 +130,7 @@ class CommandStart extends CommandPolykey {
);
stdio[2] = agentErrFile.fd;
}
const agentProcess = child_process.fork(
const agentProcess = childProcess.fork(
path.join(__dirname, '../polykey-agent'),
[],
{
Expand Down
6 changes: 3 additions & 3 deletions tests/nodes/NodeConnection.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { AddressInfo } from 'net';
import type { ConnectionInfo, Host, Port, TLSConfig } from '@/network/types';
import type { NodeId, NodeInfo } from '@/nodes/types';
import type { Server } from '@grpc/grpc-js';
import type * as child_process from 'child_process';
import type * as childProcess from 'child_process';
import net from 'net';
import os from 'os';
import path from 'path';
Expand Down Expand Up @@ -733,7 +733,7 @@ describe(`${NodeConnection.name} test`, () => {
| NodeConnection<grpcTestUtils.GRPCClientTest>
| undefined;
let testProxy: Proxy | undefined;
let testProcess: child_process.ChildProcessWithoutNullStreams | undefined;
let testProcess: childProcess.ChildProcessWithoutNullStreams | undefined;
try {
const testProcess = spawnFile('tests/grpc/utils/testServer.ts');
const waitP = promise<string>();
Expand Down Expand Up @@ -799,7 +799,7 @@ describe(`${NodeConnection.name} test`, () => {
| NodeConnection<grpcTestUtils.GRPCClientTest>
| undefined;
let testProxy: Proxy | undefined;
let testProcess: child_process.ChildProcessWithoutNullStreams | undefined;
let testProcess: childProcess.ChildProcessWithoutNullStreams | undefined;
try {
const testProcess = spawnFile('tests/grpc/utils/testServer.ts');
const waitP = promise<string>();
Expand Down
14 changes: 7 additions & 7 deletions tests/utils/exec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { ChildProcess } from 'child_process';
import type ErrorPolykey from '@/ErrorPolykey';
import type { PrivateKeyPem } from '@/keys/types';
import type { StatusLive } from '@/status/types';
import child_process from 'child_process';
import childProcess from 'child_process';
import fs from 'fs';
import path from 'path';
import process from 'process';
Expand Down Expand Up @@ -78,7 +78,7 @@ async function exec(
return new Promise((resolve, reject) => {
let stdout = '',
stderr = '';
const subprocess = child_process.spawn(command, args, {
const subprocess = childProcess.spawn(command, args, {
env,
windowsHide: true,
shell: false,
Expand Down Expand Up @@ -261,7 +261,7 @@ async function pkExecWithoutShell(
return new Promise((resolve, reject) => {
let stdout = '',
stderr = '';
const subprocess = child_process.spawn(
const subprocess = childProcess.spawn(
'ts-node',
['--project', tsConfigPath, polykeyPath, ...args],
{
Expand Down Expand Up @@ -320,7 +320,7 @@ async function pkExecWithShell(
return new Promise((resolve, reject) => {
let stdout = '',
stderr = '';
const subprocess = child_process.spawn(opts.command!, args, {
const subprocess = childProcess.spawn(opts.command!, args, {
env,
cwd,
windowsHide: true,
Expand Down Expand Up @@ -362,7 +362,7 @@ async function pkSpawnWithoutShell(
// (if not defined in the env) to ensure no attempted connections. A regular
// PolykeyAgent is expected to initially connect to the mainnet seed nodes
env['PK_SEED_NODES'] = env['PK_SEED_NODES'] ?? '';
const subprocess = child_process.spawn(
const subprocess = childProcess.spawn(
'ts-node',
['--project', tsConfigPath, polykeyPath, ...args],
{
Expand Down Expand Up @@ -409,7 +409,7 @@ async function pkSpawnWithShell(
// PolykeyAgent is expected to initially connect to the mainnet seed nodes
env['PK_SEED_NODES'] = env['PK_SEED_NODES'] ?? '';
args = args.map(escapeShellArgs);
const subprocess = child_process.spawn(opts.command!, args, {
const subprocess = childProcess.spawn(opts.command!, args, {
env,
cwd,
stdio: ['pipe', 'pipe', 'pipe'],
Expand Down Expand Up @@ -600,7 +600,7 @@ async function setupTestAgent(privateKeyPem: PrivateKeyPem, logger: Logger) {
}

function spawnFile(path: string) {
return child_process.spawn('ts-node', [
return childProcess.spawn('ts-node', [
'--require',
'tsconfig-paths/register',
path,
Expand Down

0 comments on commit 0ee0b89

Please sign in to comment.