Add check subcommand to manifest command
- Add 'check' case to manifest command that validates plugin manifest using manifest.IsValid() - Return appropriate exit codes: 0 for valid, 1 for invalid manifests - Update help text and error messages to include the new subcommand - Log validation results using structured logging 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
873bf78c22
commit
6639dad2d6
3 changed files with 12 additions and 5 deletions
10
manifest.go
10
manifest.go
|
@ -8,7 +8,7 @@ import (
|
|||
// RunManifestCommand implements the 'manifest' command functionality with subcommands.
|
||||
func RunManifestCommand(args []string, pluginPath string) error {
|
||||
if len(args) == 0 {
|
||||
return fmt.Errorf("manifest command requires a subcommand: id, version, has_server, has_webapp")
|
||||
return fmt.Errorf("manifest command requires a subcommand: id, version, has_server, has_webapp, check")
|
||||
}
|
||||
|
||||
// Convert to absolute path
|
||||
|
@ -41,8 +41,14 @@ func RunManifestCommand(args []string, pluginPath string) error {
|
|||
} else {
|
||||
fmt.Println("false")
|
||||
}
|
||||
case "check":
|
||||
if err := manifest.IsValid(); err != nil {
|
||||
Logger.Error("Plugin manifest validation failed", "error", err)
|
||||
return err
|
||||
}
|
||||
Logger.Info("Plugin manifest is valid")
|
||||
default:
|
||||
return fmt.Errorf("unknown subcommand: %s. Available subcommands: id, version, has_server, has_webapp",
|
||||
return fmt.Errorf("unknown subcommand: %s. Available subcommands: id, version, has_server, has_webapp, check",
|
||||
subcommand)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue