Skip to content

Dir: Add executablePath and workingDirectory #252

@bryphe

Description

@bryphe

In discussing the Fp.absolute* family of APIs in #251, we were discussing how hopefully users don't have to call these explicitly too often!

There are two more paths that would be useful to include in Dir that would commonly be used:

  • Dir.executablePath(): unit => Fp.t(absolute) - the absolute path to the running executable. Probably want an option to explicitly say if symlinks should be resolved or not. Having a nice API for this could really streamline the various corner cases we need to handle in Revery, today: https://github.com/revery-ui/revery/blob/4173462fc4b53fc70761f35babf1a8b9767c5b4c/src/Core/Environment.re#L59

  • Dir.workingDirectory(): unit => Fp.t(absolute) - the absolute path to the current working directory - a thin wrapper over Sys.getcwd() + Fp.absolute.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions