(scope string, appName string, osArch string)
| 14 | const DevModeCorsOrigins = "http://localhost:5173,http://localhost:5174" |
| 15 | |
| 16 | func 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 | } |
no test coverage detected