Skip to content

Commit

Permalink
fix(misc): parse args for format command
Browse files Browse the repository at this point in the history
  • Loading branch information
FrozenPandaz authored and vsavkin committed Mar 10, 2020
1 parent 0a2d5be commit 9e64253
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/workspace/src/command-line/format.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { createProjectGraph } from '../core/project-graph';
import { filterAffected } from '../core/affected-project-graph';
import { calculateFileChanges } from '../core/file-utils';
import * as yargs from 'yargs';
import { NxArgs } from './utils';
import { NxArgs, splitArgsIntoNxArgsAndOverrides } from './utils';

const PRETTIER_EXTENSIONS = [
'ts',
Expand All @@ -26,8 +26,13 @@ const PRETTIER_EXTENSIONS = [
export function format(command: 'check' | 'write', args: yargs.Arguments) {
let patterns: string[];

const { nxArgs } = splitArgsIntoNxArgsAndOverrides(args);

try {
patterns = getPatterns(args as any);
patterns = getPatterns({
...args,
...nxArgs
} as any);
} catch (e) {
output.error({
title: e.message,
Expand Down

0 comments on commit 9e64253

Please sign in to comment.