Add updateassets command with webapp code detection

- Add updateassets command to update plugin files from embedded assets
- Only include webapp assets if plugin manifest indicates webapp code presence
- Compare file contents before updating to avoid unnecessary writes
- Display count of updated files in completion message

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Felipe M 2025-07-09 16:38:26 +02:00
parent 1ea8f2b38a
commit b43e7ac3ec
No known key found for this signature in database
GPG key ID: 52E5D65FCF99808A
8 changed files with 366 additions and 0 deletions

View file

@ -49,6 +49,8 @@ func runCommand(command string, args []string, pluginPath string) error {
return runDisableCommand(args, pluginPath)
case "reset":
return runResetCommand(args, pluginPath)
case "updateassets":
return runUpdateAssetsCommand(args, pluginPath)
case "help":
showUsage()
@ -82,6 +84,10 @@ func runResetCommand(args []string, pluginPath string) error {
return pluginctl.RunResetCommand(args, pluginPath)
}
func runUpdateAssetsCommand(args []string, pluginPath string) error {
return pluginctl.RunUpdateAssetsCommand(args, pluginPath)
}
func showUsage() {
fmt.Printf(`pluginctl - Mattermost Plugin Development CLI
@ -96,6 +102,7 @@ Commands:
enable Enable plugin from current directory in Mattermost server
disable Disable plugin from current directory in Mattermost server
reset Reset plugin from current directory (disable then enable)
updateassets Update plugin files from embedded assets
help Show this help message
version Show version information
@ -105,6 +112,7 @@ Examples:
pluginctl enable # Enable plugin from current directory
pluginctl disable # Disable plugin from current directory
pluginctl reset # Reset plugin from current directory (disable then enable)
pluginctl updateassets # Update plugin files from embedded assets
export PLUGINCTL_PLUGIN_PATH=/path/to/plugin
pluginctl info # Show info using environment variable
pluginctl version # Show version information