Skip to content

Commit fae504d

Browse files
authored
Merge pull request #139 from dotnet-campus/t/lindexi/Package
[DebUOS] 尝试给所有的 sh 文件加权限
2 parents 53edb76 + d757336 commit fae504d

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

CopyAfterCompileTool/CopyAfterCompileTool/BinaryChopCompiler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public BinaryChopCompiler(IAppConfigurator appConfigurator,
7575

7676
var git = new Git(codeDirectory)
7777
{
78-
DefaultCommandTimeout = TimeSpan.FromMinutes(3)
78+
//DefaultCommandTimeout = TimeSpan.FromMinutes(3)
7979
};
8080

8181
_git = git;

DebUOS/Packaging.Targets/ArchiveBuilder.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,20 @@ private ArchiveEntryType GetArchiveEntryType(byte[] fileHeader)
417417
/// </returns>
418418
private LinuxFileMode GetFileMode(string name, /*ITaskItem metadata, */LinuxFileMode defaultMode)
419419
{
420+
// 后续可以尝试判断一下系统,在 Linux 下直接读取文件权限
421+
//if (Environment.OSVersion.Platform == PlatformID.Unix)
422+
//{
423+
//}
424+
//else
425+
//{
426+
// 在 Windows 下,直接给所有 sh 文件加权限
427+
//}
428+
429+
if (Path.GetExtension(name) == ".sh")
430+
{
431+
return defaultMode | LinuxFileMode.S_IXOTH | LinuxFileMode.S_IXGRP | LinuxFileMode.S_IWUSR | LinuxFileMode.S_IXUSR;
432+
}
433+
420434
return defaultMode;
421435

422436
//LinuxFileMode mode = defaultMode;

0 commit comments

Comments
 (0)