How to turn relative Directory into an absolute path?
See original GitHub issueI’m trying to set the OutDir property on the MSBuild task for my solution so that every project is built to a single directory (currently migrating from UpperCut that does this).
However I can’t work out how to turn the relative path when creating a Directory
object into an absolute path. Am I missing something obvious? There seems to be a MakeAbsolute
method on DirectoryPath
but that requires an ICakeEnvironment
that I can’t work out how to get either.
var buildResultDir = Directory("./build-output") + Directory("v" + semVersion) + Directory("bin";
MSBuild("./src/app.sln", settings =>
settings.SetConfiguration(configuration)
.WithProperty("OutDir", buildResultDir.Path)
.UseToolVersion(MSBuildToolVersion.Default)
.SetNodeReuse(false));
Issue Analytics
- State:
- Created 8 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
How to retrieve absolute path given relative
Try realpath . ~ $ sudo apt-get install realpath # may already be installed ~ $ realpath .bashrc /home/username/.bashrc.
Read more >How do I convert a relative to an absolute path, portably ...
This module provides functions for determining the pathname of the current working directory. Perl is generally already installed on Linux and ...
Read more >How to convert relative path to absolute path?
suppose i ahve a shell script Nsdnet.sh inside a directory /dialp/Release/bin another file nsdnet_file.csv is under the same directory. Now in ...
Read more >Expand a Relative Path in Bash | Baeldung on Linux
Learn about absolute and relative paths and how we can expand them in bash ... In Linux, paths are used to refer to...
Read more >Replacing Relative Paths with Absolute Paths in DataFrames
In this tutorial, we'll walk through the process of converting relative paths to absolute paths in a pandas DataFrame.
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
Hi @coxp ,
Version 0.4.2 is now released, in the DSL you can now write:
Thanks for your feedback and interest in Cake 👍
Hello,
You can get the current ICakeEnvironment instance via the script context.
Like this:
There is a PR waiting that adds an alias method (
MakeAbsolute
) for this, but it won’t be available until the next release.Best regards Patrik