waveterm/pkg/tsunamiutil/tsunamiutil.go
Mike Sawka e0ca73ad53
builder secrets, builder config/data tab hooked up (#2581)
builder secrets, builder config/data tab hooked up, and tsunami cors
config env var
2025-11-21 10:36:51 -08:00

32 lines
No EOL
881 B
Go

// Copyright 2025, Command Line Inc.
// SPDX-License-Identifier: Apache-2.0
package tsunamiutil
import (
"fmt"
"path/filepath"
"strings"
"github.com/wavetermdev/waveterm/pkg/wavebase"
)
const DevModeCorsOrigins = "http://localhost:5173,http://localhost:5174"
func GetTsunamiAppCachePath(scope string, appName string, osArch string) (string, error) {
cachesDir := wavebase.GetWaveCachesDir()
tsunamiCacheDir := filepath.Join(cachesDir, "tsunami-build-cache")
fullAppName := appName + "." + osArch
if strings.HasPrefix(osArch, "windows") {
fullAppName = fullAppName + ".exe"
}
fullPath := filepath.Join(tsunamiCacheDir, scope, fullAppName)
dirPath := filepath.Dir(fullPath)
err := wavebase.TryMkdirs(dirPath, 0755, "tsunami cache directory")
if err != nil {
return "", fmt.Errorf("failed to create tsunami cache directory: %w", err)
}
return fullPath, nil
}