MCPcopy
hub / github.com/wavetermdev/waveterm / GetTsunamiAppCachePath

Function GetTsunamiAppCachePath

pkg/tsunamiutil/tsunamiutil.go:16–32  ·  view source on GitHub ↗
(scope string, appName string, osArch string)

Source from the content-addressed store, hash-verified

14const DevModeCorsOrigins = "http://localhost:5173,http://localhost:5174"
15
16func GetTsunamiAppCachePath(scope string, appName string, osArch string) (string, error) {
17 cachesDir := wavebase.GetWaveCachesDir()
18 tsunamiCacheDir := filepath.Join(cachesDir, "tsunami-build-cache")
19 fullAppName := appName + "." + osArch
20 if strings.HasPrefix(osArch, "windows") {
21 fullAppName = fullAppName + ".exe"
22 }
23 fullPath := filepath.Join(tsunamiCacheDir, scope, fullAppName)
24
25 dirPath := filepath.Dir(fullPath)
26 err := wavebase.TryMkdirs(dirPath, 0755, "tsunami cache directory")
27 if err != nil {
28 return "", fmt.Errorf("failed to create tsunami cache directory: %w", err)
29 }
30
31 return fullPath, nil
32}

Callers 2

isBuildCacheUpToDateFunction · 0.92
StartMethod · 0.92

Calls 2

GetWaveCachesDirFunction · 0.92
TryMkdirsFunction · 0.92

Tested by

no test coverage detected