Skip to content

Commit

Permalink
Merge pull request #15 from atc-net/hotfix/add-missing-can-comammnd-e…
Browse files Browse the repository at this point in the history
…xecute-guards

fix: Add missing CanComammnd execute guards with DisableInstallationA…
  • Loading branch information
davidkallesen authored Nov 16, 2023
2 parents d1ec770 + 19cdbfb commit 1a6010b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ public override async Task ServiceStopCommandHandler()
}

public override bool CanServiceStartCommandHandler()
=> RunningState == ComponentRunningState.Stopped;
=> DisableInstallationActions &&
RunningState == ComponentRunningState.Stopped;

public override async Task ServiceStartCommandHandler()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,8 @@ public override async Task ServiceStopCommandHandler()
}

public override bool CanServiceStartCommandHandler()
=> RunningState == ComponentRunningState.Stopped;
=> !DisableInstallationActions &&
RunningState == ComponentRunningState.Stopped;

public override async Task ServiceStartCommandHandler()
{
Expand Down Expand Up @@ -333,7 +334,8 @@ public override async Task ServiceStartCommandHandler()

public override bool CanServiceDeployCommandHandler()
{
if (UnpackedZipFolderPath is null)
if (DisableInstallationActions ||
UnpackedZipFolderPath is null)
{
return false;
}
Expand All @@ -355,7 +357,8 @@ public override Task ServiceDeployAndStartCommandHandler()

public override bool CanServiceRemoveCommandHandler()
{
if (InstallationFolderPath is null ||
if (DisableInstallationActions ||
InstallationFolderPath is null ||
InstalledMainFilePath is null)
{
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ public override async Task ServiceStopCommandHandler()
}

public override bool CanServiceStartCommandHandler()
=> RunningState == ComponentRunningState.Stopped;
=> !DisableInstallationActions &&
RunningState == ComponentRunningState.Stopped;

public override async Task ServiceStartCommandHandler()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ public override async Task ServiceStopCommandHandler()
}

public override bool CanServiceStartCommandHandler()
=> RunningState == ComponentRunningState.Stopped;
=> !DisableInstallationActions &&
RunningState == ComponentRunningState.Stopped;

public override async Task ServiceStartCommandHandler()
{
Expand Down Expand Up @@ -195,7 +196,8 @@ public override async Task ServiceStartCommandHandler()

public override bool CanServiceDeployCommandHandler()
{
if (UnpackedZipFolderPath is null)
if (DisableInstallationActions ||
UnpackedZipFolderPath is null)
{
return false;
}
Expand All @@ -217,7 +219,8 @@ public override Task ServiceDeployAndStartCommandHandler()

public override bool CanServiceRemoveCommandHandler()
{
if (InstallationFolderPath is null ||
if (DisableInstallationActions ||
InstallationFolderPath is null ||
InstalledMainFilePath is null)
{
return false;
Expand Down

0 comments on commit 1a6010b

Please sign in to comment.