Skip to content

Commit 76f76f8

Browse files
committed
update: explicitly run distri, not os.Args[0]
On distri, packages are hermetic¹ and their os.Args[0] is a full path that identifies a specific version of the program. ① https://michael.stapelberg.ch/posts/2020-05-09-distri-hermetic-packages/
1 parent f96d98b commit 76f76f8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cmd/distri/update.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func update(ctx context.Context, args []string) error {
5858
return err
5959
}
6060

61-
cmd := exec.Command(os.Args[0], append([]string{"update"}, args...)...)
61+
cmd := exec.Command("distri", append([]string{"update"}, args...)...)
6262
log.Printf("re-executing %v", cmd.Args)
6363
// TODO: clean the environment
6464
cmd.Env = append(os.Environ(),

0 commit comments

Comments
 (0)