Skip to content
This repository has been archived by the owner on Apr 28, 2020. It is now read-only.

Commit

Permalink
Resolve hat path when applying a hat
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan Potter committed May 23, 2019
1 parent a01aa56 commit 37b20a9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion hat-examples/fish/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM codercom/ubuntu-dev

RUN sudo apt-get -y install fish
RUN sudo apt-get update && sudo apt-get -y install fish
RUN sudo chsh user -s $(which fish)

LABEL share.fish="~/.config/fish:~/.config/fish"
7 changes: 6 additions & 1 deletion hat_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,12 @@ func (b *hatBuilder) resolveHatPath() (string, error) {
return hat.ResolveGitHubPath(hatPath)
}

return hatPath, nil
hostHomeDir, err := os.UserHomeDir()
if err != nil {
return "", err
}

return resolvePath(hostHomeDir, hatPath), nil
}

// applyHat applies the hat to the base image.
Expand Down
3 changes: 3 additions & 0 deletions runcmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,9 @@ func (c *runcmd) build(gf *globalFlags, proj *project, b *hatBuilder, r *runner)
image := b.baseImage
if b.hatPath != "" {
image, err = b.applyHat()
if err != nil {
return err
}
}

// TODO proxy if container already exists.
Expand Down

0 comments on commit 37b20a9

Please sign in to comment.