Add tools command for direct binary downloads from GitHub releases

Introduces a new 'tools' command that installs development tools (golangci-lint, gotestsum)
by downloading pre-built binaries directly from GitHub releases instead of using 'go get -tool'.
This prevents modifications to plugin go.mod files and improves build reliability.

Features:
- Cross-platform support (Windows, macOS, Linux) with automatic architecture detection
- Version-specific binary naming with symlinks for easy access
- Configurable installation directory via --bin-dir flag
- Tar.gz archive extraction with binary validation
- Updated Makefile integration to use downloaded binaries

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Felipe M 2025-08-04 13:41:54 +02:00
parent f8e3266029
commit c1399f5107
No known key found for this signature in database
GPG key ID: 52E5D65FCF99808A
9 changed files with 596 additions and 102 deletions

View file

@ -81,6 +81,8 @@ func runCommand(command string, args []string, pluginPath string) error {
return runVersionCommand(args)
case "create-plugin":
return runCreatePluginCommand(args, pluginPath)
case "tools":
return runToolsCommand(args, pluginPath)
default:
return fmt.Errorf("unknown command: %s", command)
}
@ -128,6 +130,10 @@ func runCreatePluginCommand(args []string, pluginPath string) error {
return pluginctl.RunCreatePluginCommand(args, pluginPath)
}
func runToolsCommand(args []string, pluginPath string) error {
return pluginctl.RunToolsCommand(args, pluginPath)
}
func showUsage() {
usageText := `pluginctl - Mattermost Plugin Development CLI
@ -148,6 +154,7 @@ Commands:
manifest Manage plugin manifest files
logs View plugin logs
create-plugin Create a new plugin from template
tools Manage development tools (install golangci-lint, gotestsum)
version Show version information
Environment Variables: