question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support environment variables in paths

See original GitHub issue

Paths 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:closed
  • Created 9 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
rofrcommented, Sep 23, 2018

% 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?

0reactions
patriksvenssoncommented, Sep 23, 2018

Superseded by #2312

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found