Skip to content

Commit

Permalink
fix(config-tools): Resolved issue with bad config file lookup logic
Browse files Browse the repository at this point in the history
  • Loading branch information
sullivanpj committed Jan 17, 2024
1 parent f18c40c commit 9967de4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
13 changes: 2 additions & 11 deletions packages/config-tools/src/config-file/get-config-file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,8 @@ import type { StormConfigInput } from "../types";

let _static_cache: StormConfigInput | undefined = undefined;

const getConfigFileName = async (
fileName: string,
filePath?: string
): Promise<CosmiconfigResult> => {
const configFile = await cosmiconfig(fileName, { cache: true }).search(filePath);
if (!configFile || configFile.isEmpty) {
return await cosmiconfig(`${fileName}.config`, { cache: true }).search(filePath);
}

return configFile;
};
const getConfigFileName = async (fileName: string, filePath?: string): Promise<CosmiconfigResult> =>
cosmiconfig(fileName, { cache: true }).search(filePath);

/**
* Get the config file for the current Storm workspace
Expand Down
4 changes: 2 additions & 2 deletions packages/config-tools/src/utilities/get-default-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ export const getDefaultConfig = (config: Partial<StormConfig> = {}, root?: strin
}

return StormConfigSchema.parse({
...config,
...(DefaultStormConfig as Required<StormConfig>),
colors: { ...config.colors, ...DefaultColorConfig },
...config,
colors: { ...DefaultColorConfig, ...config.colors },
workspaceRoot,
name,
namespace,
Expand Down

0 comments on commit 9967de4

Please sign in to comment.