Skip to content

Commit 43cec9a

Browse files
author
Wassim CHEGHAM
committed
fix(cli): defaults were not taken into account. fixed.
1 parent ef2bc31 commit 43cec9a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const defaultStats = {
1414
imports: true,
1515
exports: true,
1616
specs: true,
17-
loc: false,
17+
loc: true,
1818
files: true
1919
};
2020

@@ -39,17 +39,17 @@ program
3939
})
4040
.parse(process.argv);
4141

42+
const tsConfigFilePath = path.join(process.cwd(), program.tsconfig);
4243
const options = process.argv.slice(2);
43-
if (options.length === 0) {
44-
// no options given, run all defaults
44+
if (options.length === 0 || program.tsconfig) {
45+
// no options given, set from defaults
4546
for(let opt in defaultStats) {
4647
if (defaultStats[opt]) {
4748
program[opt] = true;
4849
}
4950
}
5051
}
5152

52-
const tsConfigFilePath = path.join(process.cwd(), program.tsconfig);
5353
if (!fs.existsSync(tsConfigFilePath)) {
5454
console.warn(`"${tsConfigFilePath}" file not found. Abort.`);
5555
process.exit(1);

0 commit comments

Comments
 (0)