Skip to content
This repository was archived by the owner on May 15, 2025. It is now read-only.

Commit 85655dd

Browse files
authored
feat(tooling): add AddUnixSymlink extension (#1309)
1 parent 91516c1 commit 85655dd

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

source/Nuke.Tooling/ToolingExtensions.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@ public static AbsolutePath SetExecutable(this AbsolutePath path, bool updateVcsI
3232
return path;
3333
}
3434

35+
public static AbsolutePath AddUnixSymlink(this AbsolutePath path, AbsolutePath linkPath, bool force = false)
36+
{
37+
if (EnvironmentInfo.IsUnix)
38+
ProcessTasks.StartProcess("ln", $"-s{(force ? "f" : "")} {path} {linkPath}", logInvocation: false, logOutput: false);
39+
40+
return path;
41+
}
42+
3543
public static AbsolutePath SetUnixPermissions(this AbsolutePath path, string permissions)
3644
{
3745
if (EnvironmentInfo.IsUnix)

0 commit comments

Comments
 (0)