From f001ceaa477bc9a76dff2eb71dd7d4602bcae4fb Mon Sep 17 00:00:00 2001 From: Darren Shepherd Date: Thu, 24 Oct 2024 23:00:37 -0700 Subject: [PATCH] chore: do not setup runtime for special system dir --- pkg/repos/get.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/repos/get.go b/pkg/repos/get.go index a36c2fe0..cbc88be3 100644 --- a/pkg/repos/get.go +++ b/pkg/repos/get.go @@ -58,6 +58,7 @@ type Manager struct { storageDir string gitDir string runtimeDir string + systemDir string runtimes []Runtime credHelperConfig *credHelperConfig } @@ -75,6 +76,7 @@ func New(cacheDir string, runtimes ...Runtime) *Manager { storageDir: root, gitDir: filepath.Join(root, "git"), runtimeDir: filepath.Join(root, "runtimes"), + systemDir: filepath.Join(root, "system"), runtimes: runtimes, } } @@ -271,6 +273,10 @@ func (m *Manager) setup(ctx context.Context, runtime Runtime, tool types.Tool, e } func (m *Manager) GetContext(ctx context.Context, tool types.Tool, cmd, env []string) (string, []string, error) { + if strings.HasPrefix(tool.WorkingDir, m.systemDir) { + return tool.WorkingDir, env, nil + } + var isLocal bool if tool.Source.Repo == nil { isLocal = true