Skip to content

Commit

Permalink
fix: restored transparentMode in run.go
Browse files Browse the repository at this point in the history
  • Loading branch information
xplshn committed Sep 3, 2024
1 parent 9f4a7b4 commit 6ec6c0f
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions run.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ func RunFromCache(binaryName string, args []string, tempDir, trackerFile string,
return errors.New("binary name not provided")
}

binaryPath, err := exec.LookPath(binaryName)
if err == nil && transparentMode {
if verbosityLevel >= normalVerbosity {
fmt.Printf("Running '%s' from PATH...\n", binaryName)
}
return runBinary(binaryPath, args, verbosityLevel)
}

// Extract the base name of the binary
baseName := filepath.Base(binaryName)

Expand Down Expand Up @@ -71,16 +79,15 @@ func RunFromCache(binaryName string, args []string, tempDir, trackerFile string,
return err
}
return cleanCache(tempDir, trackerFile, verbosityLevel)
} else {
// Run the binary from the cache if it matches the requested binary
if verbosityLevel >= normalVerbosity {
fmt.Printf("Running '%s' from cache...\n", binaryName)
}
if err := runBinary(filepath.Join(tempDir, baseName), args, verbosityLevel); err != nil {
return err
}
return cleanCache(tempDir, trackerFile, verbosityLevel)
}
// Run the binary from the cache if it matches the requested binary
if verbosityLevel >= normalVerbosity {
fmt.Printf("Running '%s' from cache...\n", binaryName)
}
if err := runBinary(filepath.Join(tempDir, baseName), args, verbosityLevel); err != nil {
return err
}
return cleanCache(tempDir, trackerFile, verbosityLevel)
}

if verbosityLevel >= normalVerbosity {
Expand Down

0 comments on commit 6ec6c0f

Please sign in to comment.