fix: harden maintenance operations
This commit is contained in:
@@ -256,7 +256,9 @@ func (a *Adapter) Inspect(_ context.Context, active *profile.Profile) target.Ins
|
||||
}
|
||||
|
||||
func (a *Adapter) SetDesired(ctx context.Context, enabled bool, active *profile.Profile) target.OperationResult {
|
||||
if !a.Availability(ctx).Available {
|
||||
// Enabling requires a supported current Shell, but disabling must remain
|
||||
// available so reset can remove managed state after the user's Shell changes.
|
||||
if enabled && !a.Availability(ctx).Available {
|
||||
return target.OperationResult{Inspection: a.Inspect(ctx, active), Err: errors.New("Shell Target is unavailable: Bash or Zsh was not detected")}
|
||||
}
|
||||
if enabled && active == nil {
|
||||
|
||||
Reference in New Issue
Block a user