Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Normalize fable-library argument #3668

Merged
merged 3 commits into from
Dec 17, 2023
Merged

Conversation

nojaf
Copy link
Member

@nojaf nojaf commented Dec 17, 2023

Fixes #3653

The problematic code is, I believe, that

let getRelativeFileOrDirPath
fromIsDir
(fromFullPath: string)
toIsDir
(toFullPath: string)
=
// Algorithm adapted from http://stackoverflow.com/a/6244188
let pathDifference (path1: string) (path2: string) =
let mutable c = 0 //index up to which the paths are the same
let mutable d = -1 //index of trailing slash for the portion where the paths are the s
while c < path1.Length && c < path2.Length && path1.[c] = path2.[c] do
if path1.[c] = '/' then
d <- c
c <- c + 1
if c = 0 then
path2
elif c = path1.Length && c = path2.Length then
String.Empty
else
let mutable builder = ""
while c < path1.Length do
if path1.[c] = '/' then
builder <- builder + "../"
c <- c + 1
if builder.Length = 0 && path2.Length - 1 = d then
"./"
else
builder + path2.Substring(d + 1)

expects the paths already to be in / notation.
Converting this earlier on will ensure the relative paths in the import statements are fixed.

Also, trying out Windows CI again for JS. It worked on my machine.

@MangelMaxime MangelMaxime merged commit eb80e7c into fable-compiler:main Dec 17, 2023
@MangelMaxime
Copy link
Member

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enforce / separator in the JavaScript import
2 participants