Skip to content

Commit

Permalink
If no secrets - dont save state if its disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
prom3theu5 committed May 8, 2024
1 parent 0639969 commit 8f89c81
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Aspirate.Services/Implementations/StateService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ public class StateService(IFileSystem fs, IAnsiConsole logger, ISecretProvider s

public async Task SaveState(StateManagementOptions options)
{
if (options.DisableState == true && options.State.SecretState?.Secrets.Any() == false)
{
return;
}

var stateFile = fs.Path.Combine(fs.Directory.GetCurrentDirectory(), AspirateLiterals.StateFileName);
var stateAsJson = JsonSerializer.Serialize(options.State, _jsonSerializerOptions);

Expand Down

0 comments on commit 8f89c81

Please sign in to comment.