Skip to content

Commit

Permalink
fix: use normalize for glob path
Browse files Browse the repository at this point in the history
  • Loading branch information
yarastqt committed Oct 27, 2020
1 parent 29e4b11 commit 0f5e17b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/core/config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Platform } from 'style-dictionary'
import fg from 'fast-glob'
import normalize from 'normalize-path'

export type Config = {
entry: Record<string, string>
Expand All @@ -12,9 +13,11 @@ export async function loadConfig(
filters: { entries?: string[]; outputs?: string[]; [key: string]: any },
): Promise<Config> {
filters
const resolvedPath = fg.sync(path)
const resolvedPath = fg.sync(normalize(path))
if (resolvedPath.length === 0) {
throw new Error(`Cannot load config from "${path}", please check path or file are exists.`)
throw new Error(
`Cannot load config from "${normalize(path)}", please check path or file are exists.`,
)
}
const config: Config = require(resolvedPath[0])
if (filters.entries !== undefined || filters.outputs !== undefined) {
Expand Down

0 comments on commit 0f5e17b

Please sign in to comment.