mirror of
https://github.com/packwiz/packwiz.git
synced 2025-10-28 17:54:32 +01:00
Add pin and unpin commands/updated update command to work with pin & unpin (#234)
* Add pin and unpin commands/updated update command to work with pin & unpin * Inline cobra functions
This commit is contained in:
@@ -2,11 +2,12 @@ package cmd
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/packwiz/packwiz/cmdshared"
|
||||
"github.com/packwiz/packwiz/core"
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/viper"
|
||||
"os"
|
||||
)
|
||||
|
||||
// UpdateCmd represents the update command
|
||||
@@ -77,6 +78,11 @@ var UpdateCmd = &cobra.Command{
|
||||
continue
|
||||
}
|
||||
if check.UpdateAvailable {
|
||||
if v[i].Pin {
|
||||
fmt.Printf("Update skipped for pinned mod %s\n", v[i].Name)
|
||||
continue
|
||||
}
|
||||
|
||||
if !updatesFound {
|
||||
fmt.Println("Updates found:")
|
||||
updatesFound = true
|
||||
@@ -133,6 +139,10 @@ var UpdateCmd = &cobra.Command{
|
||||
fmt.Println(err)
|
||||
os.Exit(1)
|
||||
}
|
||||
if modData.Pin {
|
||||
fmt.Println("Version is pinned; run the unpin command to allow updating")
|
||||
os.Exit(1)
|
||||
}
|
||||
singleUpdatedName = modData.Name
|
||||
updaterFound := false
|
||||
for k := range modData.Update {
|
||||
|
||||
Reference in New Issue
Block a user