mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-24 03:15:36 +00:00
Allow ~ for home directory when specifying source of file
Useful when adding ssh keys Signed-off-by: Justin Cormack <justin.cormack@docker.com>
This commit is contained in:
parent
e94d0d8093
commit
1988b312d2
@ -558,7 +558,9 @@ func filesystem(m Moby, tw *tar.Writer) error {
|
||||
if f.Source == "" {
|
||||
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)
|
||||
if err != nil {
|
||||
return err
|
||||
|
Loading…
Reference in New Issue
Block a user