Support environment variables in paths
See original GitHub issuePaths should support environment variables (on Mono and Windows).
Segments surrounded by %
tokens are not technically valid paths (on Windows), but we’re going to make an exception for this. This means that we should no longer throw an exception when creating an illegal path, but mark the path as invalid. The $
token is valid on *nix systems, so a path like that will still be considered valid.
A path containing environment variables will be considered invalid. Tools and script aliases that work with paths will have to take this into consideration and act accordingly.
Path
bool Path.ContainsEnvironmentVariables()
bool IsValidPath { get; }
FilePath
FilePath ExpandEnvironmentVariables(ICakeEnvironment environment)
DirectoryPath
DirectoryPath ExpandEnvironmentVariables(ICakeEnvironment environment)
Issue Analytics
- State:
- Created 9 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
How to Set the Path and Environment Variables in Windows
In the Environment Variables window (pictured below), highlight the Path variable in the System variables section and click the Edit button. Add ...
Read more >How do I set or change the PATH system variable?
Windows 10 and Windows 8 · In Search, search for and then select: System (Control Panel) · Click the Advanced system settings link....
Read more >What are PATH and other environment variables, and how ...
A: The PATH variable sets directory paths to look in when commands are executed, both for RUN commands, and for internal calls from...
Read more >Add Tool Locations to the PATH Environment Variable
To add a path to the PATH environment variable. On the Start menu, right-click Computer. On the context menu, click Properties. In ...
Read more >about Environment Variables - PowerShell
Unlike Windows, environment variable names on macOS and Linux are case-sensitive. For example, $env:Path and $env:PATH are different environment ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
% is a valid file name char on *nix. And usually env vars are prefixed with $, at least in shell scripts. How about just support for interpolation of local variable names?
Superseded by #2312