Skip to content

Commit

Permalink
Merge pull request #20 from nizanrosh/fix/windows-appsettings
Browse files Browse the repository at this point in the history
fixed appsettings location for windows
  • Loading branch information
nizanrosh committed Jan 25, 2024
2 parents e5369a3 + 294813b commit 836e5b6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VersionPrefix>1.6.1</VersionPrefix>
<VersionPrefix>1.6.2</VersionPrefix>
<LangVersion>latest</LangVersion>

<Authors>Nizan Rosh</Authors>
Expand Down
8 changes: 6 additions & 2 deletions src/main/Okta.Aws.Cli/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,14 @@

var builder = CoconaApp.CreateBuilder(args);

var appSettingsPath = $"{AppPathResolver.GetAppPath()}/appsettings.json";
//This ensures that the appsettings.json file is taken from where the app is installed and not current dir.
var appSettingsConfig = new ConfigurationManager()
.AddJsonFile("appsettings.json", false)
.Build();

builder.Host.ConfigureAppConfiguration((_, configBuilder) =>
{
configBuilder.AddJsonFile(appSettingsPath, false)
configBuilder.AddConfiguration(appSettingsConfig)
.AddEnvironmentVariables()
.ConfigureArnMappings()
.ConfigureUserSettings()
Expand Down

0 comments on commit 836e5b6

Please sign in to comment.