Skip to content

Commit 3fcaef8

Browse files
committed
fix: archive logs for the exec command
1 parent b66b0c9 commit 3fcaef8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

internal/fileparser/fileparser.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ func ExecutablesFromImports(
8787

8888
func shortenWsPath(wsPath string, path string) string {
8989
if strings.HasPrefix(path, wsPath) {
90-
return "//" + path[len(wsPath)+1:]
90+
return "//" + strings.TrimPrefix(path[len(wsPath):], "/")
9191
}
9292

9393
return path

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ func main() {
2222
}
2323

2424
var archiveDir string
25-
if args := os.Args; len(args) > 0 && slices.Contains(executable.ValidVerbs(), executable.Verb(args[0])) {
25+
if args := os.Args; len(args) > 1 && slices.Contains(executable.ValidVerbs(), executable.Verb(args[1])) {
2626
// only create a log archive file for exec commands
2727
archiveDir = filesystem.LogsDir()
2828
}

0 commit comments

Comments
 (0)