diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-10-11 18:22:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-11 18:22:19 +0200 |
commit | cd167fc9e099a388b0245ca9529b2e0772914fd7 (patch) | |
tree | cce763788ce16b028ce3d0241751086f8be10ca4 /cmd/podman/utils.go | |
parent | 50b18847a6cdd91cd5a67beab2072534dcc59eb7 (diff) | |
parent | 102d1328c01360dc8b35e89c6199cc73bb53918e (diff) | |
download | podman-cd167fc9e099a388b0245ca9529b2e0772914fd7.tar.gz podman-cd167fc9e099a388b0245ca9529b2e0772914fd7.tar.bz2 podman-cd167fc9e099a388b0245ca9529b2e0772914fd7.zip |
Merge pull request #4201 from TomSweeneyRedHat/dev/tsweeney/updatebuildmd
Update build man page with latest Buildah changes
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 c0ddaba4e..592d7a1d1 100644 --- a/cmd/podman/utils.go +++ b/cmd/podman/utils.go @@ -2,6 +2,7 @@ package main import ( "fmt" + "os" "reflect" "runtime/debug" @@ -63,3 +64,12 @@ func aliasFlags(f *pflag.FlagSet, name string) pflag.NormalizedName { } return pflag.NormalizedName(name) } + +// Check if a file exists and is not a directory +func checkIfFileExists(name string) bool { + file, err := os.Stat(name) + if os.IsNotExist(err) { + return false + } + return !file.IsDir() +} |