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

[Feature Request] Use more idiomatic .NET functions for path #11

Open
Freymaurer opened this issue Oct 11, 2023 · 0 comments
Open

[Feature Request] Use more idiomatic .NET functions for path #11

Freymaurer opened this issue Oct 11, 2023 · 0 comments

Comments

@Freymaurer
Copy link

Freymaurer commented Oct 11, 2023

I just saw that you did write your own function for getAllPaths. This could be changed to use built in System.IO functions, as such:

Strangly enough standardizeSlashes is as good as it gets 😅

let normalizePathSeparators (str:string) = str.Replace("\\","/")

let getAllFilePaths (basePath: string) =
    let options = EnumerationOptions()
    options.RecurseSubdirectories <- true
    Directory.EnumerateFiles(basePath, "*", options)
    |> Seq.map (fun fp ->
        Path.GetRelativePath(basePath, fp)
        |> normalizePathSeparators
    )

getAllFilePaths arcRootPath

code location:

let ensureDirectory (filePath : string) =

"Empty" ARC will return:

"isa.investigation.xlsx"
"assays/.gitkeep"
"runs/.gitkeep"
"studies/.gitkeep"
"workflows/.gitkeep"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

1 participant