Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

Commit

Permalink
fix(utils): configuration is not parsed from args & args name format (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ronnetzer authored Mar 6, 2022
1 parent 2ced032 commit c84c6f7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
12 changes: 8 additions & 4 deletions packages/nx-distributed-task/src/app/nx.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import * as _Exec from '@actions/exec';
import type { context as Context } from '@actions/github';
import { getPackageManagerCommand, getPackageManagerVersion } from '@nrwl/tao/src/shared/package-manager';
import { NxArgs } from '@nrwl/workspace/src/command-line/utils';
import { names } from '@nrwl/devkit/src/utils/names';

import { Exec } from '@e-square/utils/exec';
import { BaseInputs } from '@e-square/utils/inputs';
import { debug, group, logger } from '@e-square/utils/logger';
import * as _Exec from '@actions/exec';

import { Inputs } from './inputs';
import { getPackageManagerCommand, getPackageManagerVersion } from '@nrwl/tao/src/shared/package-manager';
import { NxArgs } from '@nrwl/workspace/src/command-line/utils';

export async function assertNxInstalled(exec: Exec) {
debug(`Checking existence of nx`);
Expand All @@ -26,7 +28,9 @@ export async function nxCommand(nxCommand: string, target: string, exec: Exec, a
.withCommand(`${command} -p @nrwl/cli nx ${nxCommand}`)
.withArgs(
`--target=${target}`,
...Object.entries(args).map(([k, v]) => (typeof v === 'boolean' && v ? `--${k}` : `--${k}=${v}`))
...Object.entries(args).map(([k, v]) =>
typeof v === 'boolean' && v ? `--${names(k).fileName}` : `--${names(k).fileName}=${v}`
)
)
.build();

Expand Down
4 changes: 3 additions & 1 deletion packages/utils/src/lib/inputs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ export function getArgsInput(
mode: Parameters<typeof splitArgsIntoNxArgsAndOverrides>[1] = 'print-affected',
options?: Core.InputOptions
): NxArgs {
const args = getStringArrayInput(core, 'args', /[= ]/g, options);
const args = getStringArrayInput(core, 'args', /[= ]/g, options).map((arg) =>
arg === '-c' ? '--configuration' : arg
);
return (
splitArgsIntoNxArgsAndOverrides({ _: args, $0: '' }, mode, {
printWarnings: false,
Expand Down

0 comments on commit c84c6f7

Please sign in to comment.