Skip to content

Commit

Permalink
Merge branch 'liam_update_test'
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-fang authored and alex-fang committed Dec 12, 2023
2 parents 36d7826 + f6dba35 commit bf5ee31
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/D2L.Bmx/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -198,13 +198,20 @@
);
} );

var updateCommand = new Command( "update", "Updates BMX to the latest version" );
updateCommand.SetHandler( ( InvocationContext context ) => {
var handler = new UpdateHandler();
return handler.HandleAsync();
} );

// root command
var rootCommand = new RootCommand( "BMX grants you API access to your AWS accounts!" ) {
// put more frequently used commands first, as the order here affects help text
printCommand,
writeCommand,
loginCommand,
configureCommand,
updateCommand,
};

// start bmx
Expand All @@ -227,6 +234,7 @@
}
}

UpdateHandler.Cleanup();
await UpdateChecker.CheckForUpdatesAsync( configProvider.GetConfiguration() );

await next( context );
Expand Down
2 changes: 1 addition & 1 deletion src/D2L.Bmx/UpdateHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public async Task HandleAsync() {
await fs.FlushAsync();
fs.Dispose();
}
Console.WriteLine( "Downloaded!" );

string extension = Path.GetExtension( downloadUrl ).ToLowerInvariant();
string? extractPath = Path.GetDirectoryName( currentProcessPath );
Expand Down Expand Up @@ -111,5 +112,4 @@ private static void DecompressZipFile( string compressedFilePath, string decompr
}
}
}

}

0 comments on commit bf5ee31

Please sign in to comment.