mirror of
https://github.com/packwiz/packwiz.git
synced 2025-10-14 06:54:32 +02:00
Add --cache flag to export commands (#133)
This option allow overriding the cache directory An 'cache.directory' entry has also been added in the config
This commit is contained in:
committed by
GitHub
parent
b8be3784f6
commit
d051932bbb
@@ -4,6 +4,8 @@ import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
|
||||
"github.com/spf13/viper"
|
||||
)
|
||||
|
||||
func GetPackwizLocalStore() (string, error) {
|
||||
@@ -54,6 +56,10 @@ func GetPackwizInstallBinFile() (string, error) {
|
||||
}
|
||||
|
||||
func GetPackwizCache() (string, error) {
|
||||
configuredCache := viper.GetString("cache.directory")
|
||||
if configuredCache != "" {
|
||||
return configuredCache, nil
|
||||
}
|
||||
localStore, err := GetPackwizLocalCache()
|
||||
if err != nil {
|
||||
return "", err
|
||||
|
Reference in New Issue
Block a user