Skip to content

feat: support multiple --env-file arguments #3000

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 23, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
refactor: deduplicate assertNonArray utility function
  • Loading branch information
micalevisk committed Apr 22, 2025
commit c5df8e6a224e8883a497d87b55c2f8472cc95c7c
7 changes: 1 addition & 6 deletions actions/generate.action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,7 @@ import {
shouldGenerateSpec,
} from '../lib/utils/project-utils';
import { AbstractAction } from './abstract.action';

function assertNonArray<T>(value: T): asserts value is Exclude<T, any[]> {
if (Array.isArray(value)) {
throw new TypeError('Expected a non-array value');
}
}
import { assertNonArray } from '../lib/utils/type-assertions';

export class GenerateAction extends AbstractAction {
public async handle(inputs: Input[], options: Input[]) {
Expand Down
7 changes: 1 addition & 6 deletions actions/new.action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { EMOJIS, MESSAGES } from '../lib/ui';
import { normalizeToKebabOrSnakeCase } from '../lib/utils/formatting';
import { gracefullyExitOnPromptError } from '../lib/utils/gracefully-exit-on-prompt-error';
import { AbstractAction } from './abstract.action';
import { assertNonArray } from '../lib/utils/type-assertions';

export class NewAction extends AbstractAction {
public async handle(inputs: Input[], options: Input[]) {
Expand Down Expand Up @@ -65,12 +66,6 @@ export class NewAction extends AbstractAction {
}
}

function assertNonArray<T>(value: T): asserts value is Exclude<T, any[]> {
if (Array.isArray(value)) {
throw new TypeError('Expected a non-array value');
}
}

const getApplicationNameInput = (inputs: Input[]) =>
inputs.find((input) => input.name === 'name');

Expand Down
7 changes: 1 addition & 6 deletions actions/start.action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,7 @@ import {
import { ERROR_PREFIX } from '../lib/ui';
import { treeKillSync as killProcessSync } from '../lib/utils/tree-kill';
import { BuildAction } from './build.action';

function assertNonArray<T>(value: T): asserts value is Exclude<T, any[]> {
if (Array.isArray(value)) {
throw new TypeError('Expected a non-array value');
}
}
import { assertNonArray } from '../lib/utils/type-assertions';

export class StartAction extends BuildAction {
public async handle(commandInputs: Input[], commandOptions: Input[]) {
Expand Down
7 changes: 7 additions & 0 deletions lib/utils/type-assertions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export function assertNonArray<T>(
value: T,
): asserts value is Exclude<T, any[]> {
if (Array.isArray(value)) {
throw new TypeError('Expected a non-array value');
}
}