mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-11-28 05:00:26 +08:00
Got preview hooked up, log output hooked up, environment tab hooked up... the controller, restarting the apps. it is actually working! still lots to do and lots of hard coding to fix, but it is coming together...
30 lines
No EOL
807 B
Go
30 lines
No EOL
807 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"
|
|
)
|
|
|
|
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
|
|
} |