Skip to content

Commit

Permalink
Merge pull request #16 from nizanrosh/fix/installer-path
Browse files Browse the repository at this point in the history
fixed installer incorrect project path
  • Loading branch information
nizanrosh committed Mar 9, 2023
2 parents d374f7b + ccec5b2 commit 0599346
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 17 deletions.
Binary file modified installer/Installer.dll
Binary file not shown.
Binary file modified installer/Installer.pdb
Binary file not shown.
28 changes: 11 additions & 17 deletions src/main/Installer/Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using Installer;
using Kurukuru;
Expand All @@ -15,31 +14,26 @@
var appPath = InstallerHelper.GetAppPath(configuration);
var output = InstallerHelper.GetOutputPath(configuration);

await Spinner.StartAsync("Installing...", async spinner =>
{
spinner.SymbolSucceed = new SymbolDefinition("V", "V");
var process = Process.Start(new ProcessStartInfo
{
FileName = "dotnet",
WorkingDirectory = "../src/main/Okta.Aws.Cli/Okta.Aws.Cli.csproj",
Arguments =
$"publish --output {output} --source https://api.nuget.org/v3/index.json --configuration Release --verbosity quiet /property:WarningLevel=0"
});
await process!.WaitForExitAsync();
Console.WriteLine("Installing...");

spinner.Succeed("Installed successfully!");
var process = Process.Start(new ProcessStartInfo
{
FileName = "dotnet",
WorkingDirectory = "../",
Arguments =
$"publish src/main/Okta.Aws.Cli/Okta.Aws.Cli.csproj --output {output} --source https://api.nuget.org/v3/index.json --configuration Release --verbosity quiet /property:WarningLevel=0"
});

await process!.WaitForExitAsync();

Console.WriteLine("Adding app to machine path...\n");

if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
var name = "PATH";
var scope = EnvironmentVariableTarget.Machine;
var oldValue = Environment.GetEnvironmentVariable(name, scope);

if (InstallerHelper.ShouldUpdateWindowsPaths(oldValue!, appPath))
{
var newPaths = InstallerHelper.GetNewWindowsPaths(oldValue!, appPath);
Expand All @@ -56,7 +50,7 @@ await Spinner.StartAsync("Installing...", async spinner =>
var newPaths = InstallerHelper.GetNewLinuxPaths(paths, appPath);
await File.WriteAllLinesAsync(linuxProfileFile, newPaths);
}

await InstallerHelper.MakeOacliExecutable(appPath);
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
Expand Down

0 comments on commit 0599346

Please sign in to comment.