mirror of
https://github.com/packwiz/packwiz.git
synced 2025-11-19 01:24:32 +01:00
Add no-internal-hashes mode
This commit is contained in:
@@ -2,6 +2,7 @@ package cmd
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/spf13/viper"
|
||||
"os"
|
||||
|
||||
"github.com/comp500/packwiz/core"
|
||||
@@ -20,6 +21,12 @@ var refreshCmd = &cobra.Command{
|
||||
fmt.Println(err)
|
||||
os.Exit(1)
|
||||
}
|
||||
build, err := cmd.Flags().GetBool("build")
|
||||
if err == nil && build {
|
||||
viper.Set("no-internal-hashes", false)
|
||||
} else if viper.GetBool("no-internal-hashes") {
|
||||
fmt.Println("Note: no-internal-hashes mode is set, no hashes will be saved. Use --build to override this for distribution.")
|
||||
}
|
||||
index, err := pack.LoadIndex()
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
@@ -51,4 +58,6 @@ var refreshCmd = &cobra.Command{
|
||||
|
||||
func init() {
|
||||
rootCmd.AddCommand(refreshCmd)
|
||||
|
||||
refreshCmd.Flags().Bool("build", false, "Only has an effect in no-internal-hashes mode: generates internal hashes for distribution with packwiz-installer")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user