mirror of
https://github.com/packwiz/packwiz.git
synced 2025-10-15 07:24:32 +02:00
Linter fixes (error handling, unused constants, raw strings)
This commit is contained in:
@@ -56,6 +56,10 @@ func init() {
|
||||
_ = viper.BindPFlag("meta-folder-base", rootCmd.PersistentFlags().Lookup("meta-folder-base"))
|
||||
|
||||
defaultCacheDir, err := core.GetPackwizCache()
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
os.Exit(1)
|
||||
}
|
||||
rootCmd.PersistentFlags().String("cache", defaultCacheDir, "The directory where packwiz will cache downloaded mods")
|
||||
_ = viper.BindPFlag("cache.directory", rootCmd.PersistentFlags().Lookup("cache"))
|
||||
|
||||
|
@@ -58,7 +58,10 @@ var serveCmd = &cobra.Command{
|
||||
}
|
||||
|
||||
indexPageBuf := new(bytes.Buffer)
|
||||
t.Execute(indexPageBuf, struct{ Port string }{Port: port})
|
||||
err = t.Execute(indexPageBuf, struct{ Port string }{Port: port})
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("failed to compile index page template: %w", err))
|
||||
}
|
||||
|
||||
// Force-disable no-internal-hashes mode (equiv to --build flag in refresh) for serving over HTTP
|
||||
if viper.GetBool("no-internal-hashes") {
|
||||
|
Reference in New Issue
Block a user