Skip to content

Commit 60d0fe4

Browse files
committed
run.go: recheck cache after fetch
Signed-off-by: xplshn <xplshn@murena.io>
1 parent 32340bb commit 60d0fe4

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

run.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func runFromCache(config *Config, bEntry binaryEntry, args []string, transparent
5555
cachedFile, err := isCached(config, bEntry)
5656
if err == nil {
5757
if verbosityLevel >= normalVerbosity {
58-
fmt.Printf("Running '%s' from cache...\n", bEntry.Name)
58+
fmt.Printf("Running '%s' from cache...\n", parseBinaryEntry(bEntry, true))
5959
}
6060
if err := runBinary(cachedFile, args, verbosityLevel); err != nil {
6161
return err
@@ -64,7 +64,7 @@ func runFromCache(config *Config, bEntry binaryEntry, args []string, transparent
6464
}
6565

6666
if verbosityLevel >= normalVerbosity {
67-
fmt.Printf("Couldn't find '%s' in the cache. Fetching a new one...\n", bEntry.Name)
67+
fmt.Printf("Couldn't find '%s' in the cache. Fetching a new one...\n", parseBinaryEntry(bEntry, true))
6868
}
6969

7070
// Fetch and install the binary
@@ -80,6 +80,12 @@ func runFromCache(config *Config, bEntry binaryEntry, args []string, transparent
8080
return err
8181
}
8282

83+
// Check again if the binary is cached after installation
84+
cachedFile, err = isCached(config, bEntry)
85+
if err != nil {
86+
return fmt.Errorf("failed to find binary after installation: %v", err)
87+
}
88+
8389
if err := runBinary(cachedFile, args, verbosityLevel); err != nil {
8490
return err
8591
}

0 commit comments

Comments
 (0)