mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-20 17:49:10 +00:00
Merge pull request #79 from justincormack/tilde
Allow ~ for home directory when specifying source of file
This commit is contained in:
commit
90fd3e7e41
@ -558,7 +558,9 @@ func filesystem(m Moby, tw *tar.Writer) error {
|
|||||||
if f.Source == "" {
|
if f.Source == "" {
|
||||||
return errors.New("Contents of file not specified")
|
return errors.New("Contents of file not specified")
|
||||||
}
|
}
|
||||||
|
if len(f.Source) > 2 && f.Source[:2] == "~/" {
|
||||||
|
f.Source = homeDir() + f.Source[1:]
|
||||||
|
}
|
||||||
contents, err := ioutil.ReadFile(f.Source)
|
contents, err := ioutil.ReadFile(f.Source)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
Loading…
Reference in New Issue
Block a user