Skip to content
This repository has been archived by the owner on Nov 25, 2024. It is now read-only.

Fix path formatting on windows #3

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pascal-brand38
Copy link

On windows, this compilation is thrown:
mkdir 'D:\D:\folder\my-project\public\assets\icons'

This comes from a wrong formatted path provided in astro config in the hook "astro:config:done", which is:
/D:/folder/my-project/public/assets/icons'
instead of
D:/folder/my-project/public/assets/icons'
(note the first slash which should not be there).

Fix consists in calling fileURLToPath() to normalize the path.

Closes #1

On windows, this compilation is thrown:
    mkdir 'D:\D:\folder\my-project\public\assets\icons'

This comes from a wrong formatted path provided in
astro config in the hook "astro:config:done", which is:
    /D:/folder/my-project/public/assets/icons'
instead of
    D:/folder/my-project/public/assets/icons'
(note the first slash which should not be there).

Fix consists in calling fileURLToPath() to normalize the path.

Closes ACP-CODE#1

Signed-off-by: Pascal Brand <pascal.brand38@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Incorrect path formatting in writeFile.ts causing ENOENT error on Windows
1 participant