summaryrefslogtreecommitdiff
path: root/brewget.go
diff options
context:
space:
mode:
authoreltrac <hi@eltr.ac>2026-05-27 14:48:37 +0800
committereltrac <hi@eltr.ac>2026-05-27 14:48:37 +0800
commit886e3980c03cd056157164bc2a4a712167849270 (patch)
tree6bba64b9b41100e8ba3048aa7f92e1e452e1b889 /brewget.go
parent51ed797d38edb3f3884d69064d72108497a24818 (diff)
fix: --no-cache not working for list commandHEADmaster
Diffstat (limited to 'brewget.go')
-rw-r--r--brewget.go11
1 files changed, 8 insertions, 3 deletions
diff --git a/brewget.go b/brewget.go
index b5c8c8a..5b33b01 100644
--- a/brewget.go
+++ b/brewget.go
@@ -118,14 +118,19 @@ func GetBrewList() []string {
return list
}
-func GetBrewDeps() map[string][]string {
+func GetBrewDeps(useCache bool) map[string][]string {
depmap := map[string][]string{}
// Try reading from cache
const cachepath = "depmap.json"
- cache_data, cache_hit := ReadCache(cachepath, brewDepCacheTTL)
+ var cache_data []byte
+ var cache_hit bool
- if cache_hit {
+ if (useCache) {
+ cache_data, cache_hit = ReadCache(cachepath, brewDepCacheTTL)
+ }
+
+ if cache_hit && useCache {
// if cache hit, decode
err := json.Unmarshal(cache_data, &depmap)
if err != nil {