All files / src/commands DefaultCommand.ts

90% Statements 9/10
83.33% Branches 5/6
50% Functions 1/2
100% Lines 9/9

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 1324x     24x 24x 24x 2x 2x 2x 2x 2x    
import { argdown, ILogParserErrorsRequest, IFileRequest } from "@argdown/node";
import { Arguments } from "yargs";
 
export const command = "*";
export const desc = "load config file and run process";
export const handler = async (argv: Arguments) => {
  let config = <IFileRequest & ILogParserErrorsRequest>await argdown.loadConfig(argv.config);
  config.logLevel = argv.verbose ? "verbose" : config.logLevel;
  config.watch = argv.watch || config.watch;
  config.logParserErrors = argv.logParserErrors || config.logParserErrors;
  await argdown.load(config).catch(e => console.log(e));
};