mirror of
https://github.com/packwiz/packwiz.git
synced 2025-10-14 06:54:32 +02:00
Add no-internal-hashes mode
This commit is contained in:
@@ -157,7 +157,7 @@ var initCmd = &cobra.Command{
|
||||
Index: struct {
|
||||
File string `toml:"file"`
|
||||
HashFormat string `toml:"hash-format"`
|
||||
Hash string `toml:"hash"`
|
||||
Hash string `toml:"hash,omitempty"`
|
||||
}{
|
||||
File: indexFilePath,
|
||||
},
|
||||
|
@@ -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