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

type Windows = FileSystem<"%SystemRoot%"> // (%SystemRoot% is Environment variable) #59

Open
dzmitry-lahoda opened this issue Aug 4, 2015 · 2 comments

Comments

@dzmitry-lahoda
Copy link

Is next possible?

type Windows = FileSystem<"%SystemRoot%"> // (%SystemRoot% is Environment variable usually to "C:/Windows")

Sometimes enterprise admins setups some things which are usually on C:/ to go to other routes via Environment variables.

@vasily-kirichenko
Copy link
Contributor

It is not possible, but easy to implement.

@CaringDev
Copy link

@vasily-kirichenko The easy part is expanding the environment variables once on compile time, i.e. FileSystem<"%SystemRoot%">.Path = @"C:\Windows\". Then, when deploying the compiled program to another machine, the path stays the same, regardless of the actual value of the environment variable. @asd-and-Rizzo is this what you wanted?

I think it would be interesting to also support runtime environment variables: FileSystem<"%Public%">.DynamicPath = @"C:\Users\Public" on standard systems and @"U:\Public" on some other, regardless of the system the program was compiled on. Obviously, DynamicPath can't be [<Literal>]. What do you think?

Things to decide upon

  • Always expand paths vs. have boolean flag, e.g. FileSystem<"%SystemRoot%", expandEnvVars = true>
    Note: C:\%TMP%\%WHY%DID%%YOU%DO.that is a valid name, requiring escaping % is a breaking change.
  • To include DynamicPath / RuntimePath / ... or not? (Having above flag, provide only if switched on.)
  • Include expansion for relativeTo parameter?
  • Include expansion for RelativePath<...> provider?

All things settled, I'd volunteer for implementing.

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

No branches or pull requests

4 participants