Skip to content

Commit 5b87790

Browse files
committed
fix: šŸ› Correctly parse path segment separators
1 parent 37e5adf commit 5b87790

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ā€Žsrc/cli/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ export const getOptimizeResult: GetOptimizeResult = async ({
4646
if (formatValidate(extension)) {
4747
try {
4848
const filePath = path.join(destDir, output)
49-
const fileDir = filePath.split('/').slice(0, -1).join('/')
49+
const fileDir = filePath.split(path.sep).slice(0, -1).join(path.sep)
5050
await fs.mkdirp(fileDir)
5151

5252
const outputPath = path.join(cacheDir, output)
53-
const outputDir = outputPath.split('/').slice(0, -1).join('/')
53+
const outputDir = outputPath.split(path.sep).slice(0, -1).join(path.sep)
5454
await fs.mkdirp(outputDir)
5555

5656
const imageBuffer = await fs.readFile(originalFilePath)

0 commit comments

Comments
Ā (0)