Thanks to visit codestin.com
Credit goes to github.com

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

Commit d8a2de9

Browse files
author
Nathan Potter
authored
Merge pull request #181 from cdr/hats
Resolve hat path when applying a hat
2 parents a01aa56 + 37b20a9 commit d8a2de9

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

hat-examples/fish/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM codercom/ubuntu-dev
22

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

66
LABEL share.fish="~/.config/fish:~/.config/fish"

hat_builder.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,12 @@ func (b *hatBuilder) resolveHatPath() (string, error) {
5252
return hat.ResolveGitHubPath(hatPath)
5353
}
5454

55-
return hatPath, nil
55+
hostHomeDir, err := os.UserHomeDir()
56+
if err != nil {
57+
return "", err
58+
}
59+
60+
return resolvePath(hostHomeDir, hatPath), nil
5661
}
5762

5863
// applyHat applies the hat to the base image.

runcmd.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,9 @@ func (c *runcmd) build(gf *globalFlags, proj *project, b *hatBuilder, r *runner)
248248
image := b.baseImage
249249
if b.hatPath != "" {
250250
image, err = b.applyHat()
251+
if err != nil {
252+
return err
253+
}
251254
}
252255

253256
// TODO proxy if container already exists.

0 commit comments

Comments
 (0)