Skip to content

Commit

Permalink
(maint) Whitespace + formatting fix
Browse files Browse the repository at this point in the history
  • Loading branch information
AdmiringWorm committed Sep 23, 2022
1 parent 2f17f8b commit 506b201
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2017 - 2021 Chocolatey Software, Inc
// Copyright © 2017 - 2022 Chocolatey Software, Inc
// Copyright © 2011 - 2017 RealDimensions Software, LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
15 changes: 6 additions & 9 deletions src/chocolatey/infrastructure.app/services/PowershellService.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2017 - 2021 Chocolatey Software, Inc
// Copyright © 2017 - 2022 Chocolatey Software, Inc
// Copyright © 2011 - 2017 RealDimensions Software, LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -23,10 +23,7 @@ namespace chocolatey.infrastructure.app.services
using System.Management.Automation;
using System.Management.Automation.Runspaces;
using System.Reflection;
using System.Security.Cryptography;
using System.Text;
using adapters;
using builders;
using commandline;
using configuration;
using cryptography;
Expand All @@ -38,8 +35,6 @@ namespace chocolatey.infrastructure.app.services
using powershell;
using results;
using utility;
using Assembly = adapters.Assembly;
using Console = System.Console;
using CryptoHashProvider = cryptography.CryptoHashProvider;
using Environment = System.Environment;
using IFileSystem = filesystem.IFileSystem;
Expand Down Expand Up @@ -112,12 +107,15 @@ private IEnumerable<string> get_hook_scripts(ChocolateyConfiguration configurati
case CommandNameType.install:
filenameBase += "install-";
break;

case CommandNameType.uninstall:
filenameBase += "uninstall-";
break;

case CommandNameType.upgrade:
filenameBase += "beforemodify-";
break;

default:
throw new ApplicationException("Could not find CommandNameType '{0}' to get hook scripts".format_with(command));
}
Expand Down Expand Up @@ -353,7 +351,6 @@ public bool run_action(ChocolateyConfiguration configuration, PackageResult pack
`choco -h` for details.");
}


if (result.ExitCode != 0)
{
Environment.ExitCode = result.ExitCode;
Expand Down Expand Up @@ -534,7 +531,7 @@ public void prepare_powershell_environment(IPackage package, ChocolateyConfigura
}
}

SecurityProtocol.set_protocol(configuration, provideWarning:false);
SecurityProtocol.set_protocol(configuration, provideWarning: false);
}

private ResolveEventHandler _handler = null;
Expand Down Expand Up @@ -738,11 +735,11 @@ public PowerShellExecutionResults run_host(ChocolateyConfiguration config, strin
if (host.ExitCode == 0) host.SetShouldExit(1);
host.HostException = pipeline.PipelineStateInfo.Reason;
break;

case PipelineState.Completed:
if (host.ExitCode == -1) host.SetShouldExit(0);
break;
}

}
}
}
Expand Down

0 comments on commit 506b201

Please sign in to comment.