Skip to content

Commit

Permalink
fix: correct behavior when config option is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
mugi-uno committed Mar 29, 2024
1 parent 1b8c6bb commit e2b1ab2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/analyze.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const analyze = async ({
configFilePath,
...cliArgs
}: AnalyzeArgs & {
configFilePath?: string;
configFilePath: string;
}) => {
console.log("🔎 Analyzing dependencies...");

Expand Down
2 changes: 1 addition & 1 deletion src/extract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const extract = async ({
configFilePath,
...cliArgs
}: ExtractArgs & {
configFilePath?: string;
configFilePath: string;
}) => {
console.log("🔪 Extract licenses...");

Expand Down
6 changes: 2 additions & 4 deletions src/functions/loadConfigScript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ import fs from "fs";
import path from "path";
import { Config } from "../types";

export const loadConfigScript = async (
relativeConfigPath: string = "license-manager.config.js"
): Promise<Partial<Config>> => {
const configPath = path.join(process.cwd(), relativeConfigPath);
export const loadConfigScript = async (relativeConfigPath: string): Promise<Partial<Config>> => {
const configPath = path.join(process.cwd(), relativeConfigPath || "license-manager.config.js");

if (!fs.existsSync(configPath)) {
return {};
Expand Down

0 comments on commit e2b1ab2

Please sign in to comment.