Compare commits

..

No commits in common. "f8e32660291f285d2aaf1cbbc391d2c6ac1d6cb2" and "353cc9efc78727a57034544ba38e044d9c3873aa" have entirely different histories.

3 changed files with 10 additions and 33 deletions

View file

@ -5,7 +5,7 @@
## Install go tools ## Install go tools
install-go-tools: install-go-tools:
@echo Installing go tools @echo Installing go tools
$(GO) install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.64.8 $(GO) install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.61.0
$(GO) install gotest.tools/gotestsum@v1.7.0 $(GO) install gotest.tools/gotestsum@v1.7.0
## Runs eslint and golangci-lint ## Runs eslint and golangci-lint

View file

@ -108,7 +108,7 @@ func SavePluginCtlConfig(manifest *model.Manifest, config *PluginCtlConfig) {
manifest.Props["pluginctl"] = config manifest.Props["pluginctl"] = config
} }
// ValidateAndUpdateVersion checks the plugin version for compatibility. // ValidateAndUpdateVersion checks the plugin version and updates it if necessary.
func ValidateAndUpdateVersion(pluginPath string) error { func ValidateAndUpdateVersion(pluginPath string) error {
// Load the manifest // Load the manifest
manifest, err := LoadPluginManifestFromPath(pluginPath) manifest, err := LoadPluginManifestFromPath(pluginPath)
@ -135,33 +135,15 @@ func ValidateAndUpdateVersion(pluginPath string) error {
config.Version, currentVersion) config.Version, currentVersion)
} }
return nil // Update version if different
} if config.Version != currentVersion {
config.Version = currentVersion
SavePluginCtlConfig(manifest, config)
// UpdatePluginCtlVersion updates the pluginctl version in the manifest. // Save the updated manifest
func UpdatePluginCtlVersion(pluginPath string) error { if err := WritePluginManifest(manifest, pluginPath); err != nil {
// Load the manifest return fmt.Errorf("failed to update version in manifest: %w", err)
manifest, err := LoadPluginManifestFromPath(pluginPath) }
if err != nil {
return fmt.Errorf("failed to load plugin manifest: %w", err)
}
// Get current pluginctl version
currentVersion := GetVersion()
// Parse existing pluginctl config
config, err := ParsePluginCtlConfig(manifest)
if err != nil {
return fmt.Errorf("failed to parse pluginctl config: %w", err)
}
// Update version
config.Version = currentVersion
SavePluginCtlConfig(manifest, config)
// Save the updated manifest
if err := WritePluginManifest(manifest, pluginPath); err != nil {
return fmt.Errorf("failed to update version in manifest: %w", err)
} }
return nil return nil

View file

@ -87,11 +87,6 @@ Examples:
Logger.Info("Assets updated successfully!", "files_updated", updatedCount) Logger.Info("Assets updated successfully!", "files_updated", updatedCount)
// Store the current pluginctl version in the manifest after successful update
if err := UpdatePluginCtlVersion(pluginPath); err != nil {
return fmt.Errorf("failed to save version to manifest: %w", err)
}
return nil return nil
} }