Skip to content

Commit af26615

Browse files
committed
Revert "Ensure executable permissions in Linux and OSX"
This reverts commit 8d6981d.
1 parent 8d6981d commit af26615

File tree

4 files changed

+2
-25
lines changed

4 files changed

+2
-25
lines changed

lib/PuppeteerSharp.Tests/PuppeteerSharp.Tests.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
1212
<PackageReference Include="SixLabors.ImageSharp" Version="1.0.0-beta0002" />
1313
<PackageReference Include="PdfSharp" Version="1.50.4845-RC2a" NoWarn="NU1701" />
14-
<PackageReference Include="Mono.Posix.NETStandard" Version="1.0.0" />
1514
</ItemGroup>
1615
<ItemGroup>
1716
<Folder Include="Issues\" />

lib/PuppeteerSharp.Tests/PuppeteerTests/BrowserFetcherTests.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using System;
22
using System.IO;
3-
using System.Runtime.InteropServices;
43
using System.Threading.Tasks;
54
using Xunit;
65
using Xunit.Abstractions;
@@ -33,12 +32,6 @@ public async Task ShouldDownloadAndExtractLinuxBinary()
3332
revisionInfo = await browserFetcher.DownloadAsync(123456);
3433
Assert.True(revisionInfo.Local);
3534
Assert.Equal("LINUX BINARY\n", File.ReadAllText(revisionInfo.ExecutablePath));
36-
37-
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX) || RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
38-
{
39-
Mono.Unix.Native.Syscall.stat(revisionInfo.ExecutablePath, out var stat);
40-
Assert.Equal(BrowserFetcher.BrowserPermissionsInLinux, stat.st_mode & BrowserFetcher.BrowserPermissionsInLinux);
41-
}
4235
Assert.Equal(new[] { 123456 }, browserFetcher.LocalRevisions());
4336
browserFetcher.Remove(123456);
4437
Assert.Empty(browserFetcher.LocalRevisions());

lib/PuppeteerSharp/BrowserFetcher.cs

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
using System.Threading.Tasks;
99
using System.Net;
1010
using System.IO.Compression;
11-
using Mono.Unix.Native;
1211

1312
namespace PuppeteerSharp
1413
{
@@ -34,13 +33,6 @@ public class BrowserFetcher
3433
{Platform.Win64, "{0}/chromium-browser-snapshots/Win_x64/{1}/chrome-win32.zip"}
3534
};
3635

37-
internal static readonly FilePermissions BrowserPermissionsInLinux =
38-
FilePermissions.S_IRWXU |
39-
FilePermissions.S_IRGRP |
40-
FilePermissions.S_IXGRP |
41-
FilePermissions.S_IROTH |
42-
FilePermissions.S_IXOTH;
43-
4436
/// <summary>
4537
/// Default chromiumg revision.
4638
/// </summary>
@@ -172,7 +164,7 @@ public async Task<RevisionInfo> DownloadAsync(int revision)
172164

173165
if (new DirectoryInfo(folderPath).Exists)
174166
{
175-
return RevisionInfo(revision);
167+
return null;
176168
}
177169

178170
var downloadFolder = new DirectoryInfo(DownloadsFolder);
@@ -203,13 +195,7 @@ public async Task<RevisionInfo> DownloadAsync(int revision)
203195

204196
new FileInfo(zipPath).Delete();
205197

206-
var revisionInfo = RevisionInfo(revision);
207-
208-
if (revisionInfo != null && (GetCurrentPlatform() == Platform.Linux || GetCurrentPlatform() == Platform.MacOS))
209-
{
210-
Syscall.chmod(revisionInfo.ExecutablePath, BrowserPermissionsInLinux);
211-
}
212-
return revisionInfo;
198+
return RevisionInfo(revision);
213199
}
214200

215201
/// <summary>

lib/PuppeteerSharp/PuppeteerSharp.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,5 @@ Changes
4242
<PackageReference Include="System.Net.Http" Version="4.3.3" />
4343
<PackageReference Include="Microsoft.AspNetCore.WebUtilities" Version="2.0.2" />
4444
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.5.1" />
45-
<PackageReference Include="Mono.Posix.NETStandard" Version="1.0.0" />
4645
</ItemGroup>
4746
</Project>

0 commit comments

Comments
 (0)