Skip to content

Commit 30202e7

Browse files
shota-kizawakazupon
authored andcommitted
fix: I took into account the format of the path. (#155)
* feat: Add ignore option in cli (infuse, squeeze) * fix: utils & ignore option test * fix: lint * feat: infuse ignore test * fix: path relative
1 parent e5057f1 commit 30202e7

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/utils.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -135,16 +135,11 @@ export function stringifyContent (content: any, lang: string, options?: FormatOp
135135
}
136136

137137
export function readSFC (target: string, ignorePath?: string): SFCFileInfo[] {
138-
let targets = resolveGlob(target)
138+
let targets = resolveGlob(path.relative(process.cwd(), target))
139139
if ((ignorePath !== undefined)) {
140140
const ig = returnIgnoreInstance(ignorePath)
141141
targets = targets.filter(t => {
142-
if (path.isAbsolute(t)) {
143-
console.debug('Target is absolute path. Please change relative path.')
144-
return !ig.ignores(path.relative('/', t))
145-
} else {
146-
return !ig.ignores(path.relative('./', t))
147-
}
142+
return !ig.ignores(path.relative(process.cwd(), t))
148143
})
149144
}
150145
debug('readSFC: targets = ', targets)

0 commit comments

Comments
 (0)