mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-25 11:05:45 +00:00
version/mkversion: allow env config of oss git cache dir
Updates tailscale/corp#21262 Change-Id: I80bd880b53f6d851c15479f39fad62b25f1095f1 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
parent
ddf94a7b39
commit
da32468988
@ -336,11 +336,14 @@ type verInfo struct {
|
||||
const unknownPatchVersion = 9999999
|
||||
|
||||
func infoFromCache(ref string, runner dirRunner) (verInfo, error) {
|
||||
cacheDir, err := os.UserCacheDir()
|
||||
if err != nil {
|
||||
return verInfo{}, fmt.Errorf("Getting user cache dir: %w", err)
|
||||
tailscaleCache := os.Getenv("TS_MKVERSION_OSS_GIT_CACHE")
|
||||
if tailscaleCache == "" {
|
||||
cacheDir, err := os.UserCacheDir()
|
||||
if err != nil {
|
||||
return verInfo{}, fmt.Errorf("Getting user cache dir: %w", err)
|
||||
}
|
||||
tailscaleCache = filepath.Join(cacheDir, "tailscale-oss")
|
||||
}
|
||||
tailscaleCache := filepath.Join(cacheDir, "tailscale-oss")
|
||||
r := dirRunner(tailscaleCache)
|
||||
|
||||
if _, err := os.Stat(tailscaleCache); err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user