Skip to content

Commit 18515af

Browse files
DavidParks8dherges
authored andcommitted
fix: regression in cli defaults
1 parent 80de0e6 commit 18515af

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/cli/main.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,19 @@ import * as program from 'commander';
44
import * as path from 'path';
55
import { createNgPackage, NgPackagrCliArguments } from './../lib/ng-packagr';
66

7+
const DEFAULT_PROJECT_PATH = path.resolve(process.cwd(), 'ng-package.json');
8+
79
function parseProjectPath(parsed: string): string {
8-
return parsed || path.resolve(process.cwd(), 'ng-package.json');
10+
return parsed || DEFAULT_PROJECT_PATH;
911
}
1012

1113
program
1214
.name('ng-packagr')
13-
.option('-p, --project <path>', 'Path to the \'ng-package.json\' or \'package.json\' file.', parseProjectPath)
15+
.option(
16+
'-p, --project <path>',
17+
'Path to the \'ng-package.json\' or \'package.json\' file.',
18+
parseProjectPath,
19+
DEFAULT_PROJECT_PATH)
1420
.parse(process.argv);
1521

1622
const cliArguments: any = program;

0 commit comments

Comments
 (0)