Help with copy files on MacOS #3784
-
I'm trying to Move a file and rename it at the same time. This is the Provision Profile folder which is hidden by default. ` string provPath = $"{directory.ToString()}/{BranchProject}/adhoc.mobileprovision";
But when I execute the move file I get this error: How can I specify the root folder on the MacOS? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
An easy way is to leverage the #addin "nuget:?package=Cake.PathTildeHelper&version=4.0.0"
Information(PathReplaceTilde(new FilePath("~/Documents/awesome-stuff.txt"))); Alternatively, if you want to resolve it yourself using .NET/C#, you can call var userProfileFolder = System.Environment.GetFolderPath(System.Environment.SpecialFolder.UserProfile); |
Beta Was this translation helpful? Give feedback.
-
Gotcha. I saw you using In MacOS the root folder would be var filePath = new FilePath("/System/Library/Fonts/Supplemental/Arial Unicode.ttf");
CopyFile(filePath, "./MyFont.ttf"); |
Beta Was this translation helpful? Give feedback.
Gotcha. I saw you using
~
which would resolve to the user profile folder and thought you were having issues with Cake doing that.In MacOS the root folder would be
/System
: