diff options
author | Matthew Heon <matthew.heon@pm.me> | 2019-11-04 10:08:17 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-04 10:08:17 -0500 |
commit | 8e5aad97dda150f8e871c1b394824496f4b849ea (patch) | |
tree | 398ca3e287a1b7f0670afa3d280b724bc7c2f96a /cmd/podman/utils.go | |
parent | efc7f1557b4af90263f4f07e5e576b02e839fad1 (diff) | |
parent | 677a0e5d60c45711cba56032c23783c1d010a49e (diff) | |
download | podman-8e5aad97dda150f8e871c1b394824496f4b849ea.tar.gz podman-8e5aad97dda150f8e871c1b394824496f4b849ea.tar.bz2 podman-8e5aad97dda150f8e871c1b394824496f4b849ea.zip |
Merge pull request #4389 from TomSweeneyRedHat/dev/tsweeney/contextdir
Validate contextdir on build
Diffstat (limited to 'cmd/podman/utils.go')
-rw-r--r-- | cmd/podman/utils.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/cmd/podman/utils.go b/cmd/podman/utils.go index c19e6391e..21389b43a 100644 --- a/cmd/podman/utils.go +++ b/cmd/podman/utils.go @@ -74,3 +74,13 @@ func checkIfFileExists(name string) bool { } return !file.IsDir() } + +// Check if a file is or is not a directory +func fileIsDir(name string) bool { + file, err := os.Stat(name) + // All errors return file == nil + if err != nil { + return false + } + return file.IsDir() +} |