Skip to content

Commit

Permalink
Preserve GOKRAZY_PARENT_DIR when executing sudo (#76)
Browse files Browse the repository at this point in the history
This should fix `gok overwrite` not fully utilizing this environment
variable as mentioned in a comment on gokrazy/gokrazy#222.
  • Loading branch information
vilhalmer authored Jan 20, 2025
1 parent ca8464f commit 8edbabf
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions internal/packer/parttable.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ func (p *Pack) SudoPartition(path string) (*os.File, error) {
cmd.Env = []string{
"GOKR_PACKER_FD=1",
fmt.Sprintf("HOME=%s", os.Getenv("HOME")), // for instance config detection
fmt.Sprintf("GOKRAZY_PARENT_DIR=%s", os.Getenv("GOKRAZY_PARENT_DIR")), // ditto
}
cmd.Stdout = os.NewFile(uintptr(pair[1]), "")
cmd.Stderr = os.Stderr
Expand Down

0 comments on commit 8edbabf

Please sign in to comment.