Merge pull request #2015 from ellismg/fix-2004
Fix permissions when packaging artifacts
This commit is contained in:
commit
5bf6088a47
1 changed files with 17 additions and 0 deletions
|
@ -61,6 +61,8 @@ namespace Microsoft.DotNet.Cli.Build
|
||||||
|
|
||||||
Directory.CreateDirectory(cliSdkRoot);
|
Directory.CreateDirectory(cliSdkRoot);
|
||||||
Utils.CopyDirectoryRecursively(Path.Combine(Dirs.Stage2, "sdk"), cliSdkRoot, true);
|
Utils.CopyDirectoryRecursively(Path.Combine(Dirs.Stage2, "sdk"), cliSdkRoot, true);
|
||||||
|
FixPermissions(cliSdkRoot);
|
||||||
|
|
||||||
c.BuildContext["CLISDKRoot"] = cliSdkRoot;
|
c.BuildContext["CLISDKRoot"] = cliSdkRoot;
|
||||||
return c.Success();
|
return c.Success();
|
||||||
}
|
}
|
||||||
|
@ -81,6 +83,7 @@ namespace Microsoft.DotNet.Cli.Build
|
||||||
var destFile = file.Replace(Dirs.Stage2, sharedHostRoot);
|
var destFile = file.Replace(Dirs.Stage2, sharedHostRoot);
|
||||||
File.Copy(file, destFile, true);
|
File.Copy(file, destFile, true);
|
||||||
}
|
}
|
||||||
|
FixPermissions(sharedHostRoot);
|
||||||
|
|
||||||
c.BuildContext["SharedHostPublishRoot"] = sharedHostRoot;
|
c.BuildContext["SharedHostPublishRoot"] = sharedHostRoot;
|
||||||
return c.Success();
|
return c.Success();
|
||||||
|
@ -97,6 +100,8 @@ namespace Microsoft.DotNet.Cli.Build
|
||||||
|
|
||||||
Directory.CreateDirectory(sharedFxRoot);
|
Directory.CreateDirectory(sharedFxRoot);
|
||||||
Utils.CopyDirectoryRecursively(Path.Combine(Dirs.Stage2, "shared"), sharedFxRoot, true);
|
Utils.CopyDirectoryRecursively(Path.Combine(Dirs.Stage2, "shared"), sharedFxRoot, true);
|
||||||
|
FixPermissions(sharedFxRoot);
|
||||||
|
|
||||||
c.BuildContext["SharedFrameworkPublishRoot"] = sharedFxRoot;
|
c.BuildContext["SharedFrameworkPublishRoot"] = sharedFxRoot;
|
||||||
return c.Success();
|
return c.Success();
|
||||||
}
|
}
|
||||||
|
@ -242,5 +247,17 @@ namespace Microsoft.DotNet.Cli.Build
|
||||||
.Execute()
|
.Execute()
|
||||||
.EnsureSuccessful();
|
.EnsureSuccessful();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void FixPermissions(string directory)
|
||||||
|
{
|
||||||
|
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
||||||
|
{
|
||||||
|
// Reset everything to user readable/writeable and group and world readable.
|
||||||
|
FS.ChmodAll(directory, "*", "644");
|
||||||
|
|
||||||
|
// Now make things that should be executable, executable.
|
||||||
|
FS.FixModeFlags(directory);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue