diff --git a/hat-examples/fish/Dockerfile b/hat-examples/fish/Dockerfile index 4894ff3..8a52f83 100644 --- a/hat-examples/fish/Dockerfile +++ b/hat-examples/fish/Dockerfile @@ -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" diff --git a/hat_builder.go b/hat_builder.go index 20dd761..9a72d90 100644 --- a/hat_builder.go +++ b/hat_builder.go @@ -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. diff --git a/runcmd.go b/runcmd.go index 81a9915..8d14734 100644 --- a/runcmd.go +++ b/runcmd.go @@ -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.