From f59545d97a80bf06025bf6343a80d834c7eb237f Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 6 Jul 2021 10:22:37 +0200 Subject: Rename command files --- shared/extra-utils/cli/cli-command.ts | 23 +++++++++++++++++++++++ shared/extra-utils/cli/cli.ts | 23 ----------------------- shared/extra-utils/cli/index.ts | 2 +- 3 files changed, 24 insertions(+), 24 deletions(-) create mode 100644 shared/extra-utils/cli/cli-command.ts delete mode 100644 shared/extra-utils/cli/cli.ts (limited to 'shared/extra-utils/cli') diff --git a/shared/extra-utils/cli/cli-command.ts b/shared/extra-utils/cli/cli-command.ts new file mode 100644 index 000000000..bc1dddc68 --- /dev/null +++ b/shared/extra-utils/cli/cli-command.ts @@ -0,0 +1,23 @@ +import { exec } from 'child_process' +import { AbstractCommand } from '../shared' + +export class CLICommand extends AbstractCommand { + + static exec (command: string) { + return new Promise((res, rej) => { + exec(command, (err, stdout, _stderr) => { + if (err) return rej(err) + + return res(stdout) + }) + }) + } + + getEnv () { + return `NODE_ENV=test NODE_APP_INSTANCE=${this.server.internalServerNumber}` + } + + async execWithEnv (command: string) { + return CLICommand.exec(`${this.getEnv()} ${command}`) + } +} diff --git a/shared/extra-utils/cli/cli.ts b/shared/extra-utils/cli/cli.ts deleted file mode 100644 index bc1dddc68..000000000 --- a/shared/extra-utils/cli/cli.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { exec } from 'child_process' -import { AbstractCommand } from '../shared' - -export class CLICommand extends AbstractCommand { - - static exec (command: string) { - return new Promise((res, rej) => { - exec(command, (err, stdout, _stderr) => { - if (err) return rej(err) - - return res(stdout) - }) - }) - } - - getEnv () { - return `NODE_ENV=test NODE_APP_INSTANCE=${this.server.internalServerNumber}` - } - - async execWithEnv (command: string) { - return CLICommand.exec(`${this.getEnv()} ${command}`) - } -} diff --git a/shared/extra-utils/cli/index.ts b/shared/extra-utils/cli/index.ts index 8a3f31e2f..91b5abfbe 100644 --- a/shared/extra-utils/cli/index.ts +++ b/shared/extra-utils/cli/index.ts @@ -1 +1 @@ -export * from './cli' +export * from './cli-command' -- cgit v1.2.3