Replies: 5 comments
-
There may be a more concise way, but this seems to work:
|
Beta Was this translation helpful? Give feedback.
-
Hello, You can get the current ICakeEnvironment instance via the script context. Like this: path = path.MakeAbsolute(Context.Environment) There is a PR waiting that adds an alias method ( Best regards |
Beta Was this translation helpful? Give feedback.
-
Hi @coxp , Version 0.4.2 is now released, in the DSL you can now write: var file = MakeAbsolute(File("./path"))
var dir = MakeAbsolute(Directory("./path")) Thanks for your feedback and interest in Cake 👍 |
Beta Was this translation helpful? Give feedback.
-
Works great. Thanks 👍 |
Beta Was this translation helpful? Give feedback.
-
Excellent:+1: |
Beta Was this translation helpful? Give feedback.
-
I'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 aMakeAbsolute
method onDirectoryPath
but that requires anICakeEnvironment
that I can't work out how to get either.Beta Was this translation helpful? Give feedback.
All reactions