Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions bin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

const { Command } = require("commander");
const { spawn } = require("child_process");
const chalk = require("chalk");
const path = require("path");
const { findError } = require("../lib/matcher");
const { formatError } = require("../lib/formatter");
Expand All @@ -22,6 +21,7 @@ program
.description("Run a Javascript file and analyze crashes")
.action(async (file) => {
const { default: ora } = await import("ora");
const { default: chalk } = await import("chalk");

const isJson = Boolean(program.opts().json);
const filePath = path.resolve(process.cwd(), file);
Expand Down Expand Up @@ -118,7 +118,8 @@ program
program
.command("analyze <errorString>")
.description("Analyze a specific error string")
.action((errorString) => {
.action(async (errorString) => {
const { default: chalk } = await import("chalk");
const isJson = Boolean(program.opts().json);
const { count, matches } = findError(errorString);
const exitCode = count > 0 ? 1 : 0;
Expand Down