From 937314c74a40dc6ec8753fe27ac603290bed0d35 Mon Sep 17 00:00:00 2001 From: Dylan Smith Date: Wed, 30 Mar 2022 12:25:39 -0500 Subject: [PATCH] Rolling back the +x bit change in v0.10 (#297) * rolled back +x change because it breaks macos --- RELEASENOTES.md | 5 ++--- src/ado2gh/Commands/GenerateScriptCommand.cs | 8 -------- src/ado2gh/ado2gh.csproj | 3 +-- src/gei/Commands/GenerateScriptCommand.cs | 9 --------- src/gei/gei.csproj | 1 - 5 files changed, 3 insertions(+), 23 deletions(-) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 2396e37b4..c21210cb2 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -1,4 +1,3 @@ -- Updates most commands to be idempotent. They will check if there is anything to do, and if not they will print a message to that effect and complete successfully. E.g. create-team will check if the team already exists and if so exit as success (compared to previously where it would crash). The following commands have been updated: - - configure-autolink - - create-team +- Updating commands to be idempotent. They will check if there is anything to do, and if not they will print a message to that effect and complete successfully. E.g. create-team will check if the team already exists and if so exit as success (compared to previously where it would crash). The following commands have been updated: - disable-ado-repo +- The change to automatically set the +x bit on the generated migration script has been rolled back (introduced in v0.10). We discovered a bug with this that caused `generate-script` to crash on MacOS. We're temporarily rolling this back to unblock customers while we investigate and fix the problem. diff --git a/src/ado2gh/Commands/GenerateScriptCommand.cs b/src/ado2gh/Commands/GenerateScriptCommand.cs index ce509a4cc..7a7beb5dc 100644 --- a/src/ado2gh/Commands/GenerateScriptCommand.cs +++ b/src/ado2gh/Commands/GenerateScriptCommand.cs @@ -4,10 +4,8 @@ using System.CommandLine.Invocation; using System.IO; using System.Linq; -using System.Runtime.InteropServices; using System.Text; using System.Threading.Tasks; -using Mono.Unix; using OctoshiftCLI.Extensions; namespace OctoshiftCLI.AdoToGithub.Commands @@ -109,12 +107,6 @@ public async Task Invoke(string githubOrg, string adoOrg, FileInfo output, bool if (output != null) { await File.WriteAllTextAsync(output.FullName, script); - // +x so script can be executed on macos and linux - if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux) || RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) - { - var unixFileInfo = new UnixFileInfo(output.FullName); - unixFileInfo.FileAccessPermissions |= FileAccessPermissions.UserExecute | FileAccessPermissions.GroupExecute | FileAccessPermissions.OtherExecute; - } } } diff --git a/src/ado2gh/ado2gh.csproj b/src/ado2gh/ado2gh.csproj index 0a777eb0e..fbf43af59 100644 --- a/src/ado2gh/ado2gh.csproj +++ b/src/ado2gh/ado2gh.csproj @@ -10,8 +10,7 @@ - - + diff --git a/src/gei/Commands/GenerateScriptCommand.cs b/src/gei/Commands/GenerateScriptCommand.cs index 4596dc56e..c6a932d97 100644 --- a/src/gei/Commands/GenerateScriptCommand.cs +++ b/src/gei/Commands/GenerateScriptCommand.cs @@ -4,10 +4,8 @@ using System.CommandLine.Invocation; using System.IO; using System.Linq; -using System.Runtime.InteropServices; using System.Text; using System.Threading.Tasks; -using Mono.Unix; using OctoshiftCLI.Extensions; namespace OctoshiftCLI.GithubEnterpriseImporter.Commands @@ -165,13 +163,6 @@ await InvokeAdo(adoSourceOrg, githubTargetOrg, sequential) : if (output != null) { await File.WriteAllTextAsync(output.FullName, script); - - // +x so script can be executed on macos and linux - if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux) || RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) - { - var unixFileInfo = new UnixFileInfo(output.FullName); - unixFileInfo.FileAccessPermissions |= FileAccessPermissions.UserExecute | FileAccessPermissions.GroupExecute | FileAccessPermissions.OtherExecute; - } } } diff --git a/src/gei/gei.csproj b/src/gei/gei.csproj index c211a5912..d69bd51b8 100644 --- a/src/gei/gei.csproj +++ b/src/gei/gei.csproj @@ -10,7 +10,6 @@ -