Files
ant-black 70132417ad publish: 1.2.0 snapshot (f3d7ec5)
channel: master

version: 1.2.0

source-ref: D:\code\open_source\ant-chrome master

source-commit: f3d7ec5

merged-public-base: 3d264eb
2026-05-05 18:08:10 +08:00

58 lines
978 B
Go

package automation
import (
"context"
"fmt"
"strings"
)
type runtimeInstallWorkspace struct {
TempRoot string
StagingDir string
}
func (w runtimeInstallWorkspace) cleanup() {
_ = removeRuntimeInstallWorkspace(w.StagingDir)
}
func ensureRuntimeInstallContext(ctx context.Context) context.Context {
if ctx == nil {
return context.Background()
}
return ctx
}
func (m *Manager) beginRuntimeInstall(flagAlreadySet bool) bool {
if flagAlreadySet {
return true
}
m.mu.Lock()
defer m.mu.Unlock()
if m.installing {
return false
}
m.installing = true
m.lastError = ""
return true
}
func (m *Manager) finishRuntimeInstall() {
m.mu.Lock()
m.installing = false
m.mu.Unlock()
}
func validateRuntimeVersion(runtimeVersion string) error {
if strings.TrimSpace(runtimeVersion) == "" {
return fmt.Errorf("automation runtime version is empty")
}
return nil
}
func (m *Manager) clearRuntimeInstallError() {
m.mu.Lock()
m.lastError = ""
m.mu.Unlock()
}