Add enable/disable/reset commands

This commit is contained in:
Felipe M 2025-07-09 14:01:23 +02:00
parent fd6e4a4513
commit 1ea8f2b38a
No known key found for this signature in database
GPG key ID: 52E5D65FCF99808A
11 changed files with 221 additions and 163 deletions

25
reset.go Normal file
View file

@ -0,0 +1,25 @@
package pluginctl
import (
"context"
"github.com/mattermost/mattermost/server/public/model"
)
func RunResetCommand(args []string, pluginPath string) error {
return runPluginCommand(args, pluginPath, resetPlugin)
}
func resetPlugin(ctx context.Context, client *model.Client4, pluginID string) error {
err := disablePlugin(ctx, client, pluginID)
if err != nil {
return err
}
err = enablePlugin(ctx, client, pluginID)
if err != nil {
return err
}
return nil
}