From 60624f948bf0067059f3d05e1bdc54589a9911e9 Mon Sep 17 00:00:00 2001 From: Valentin Rothberg Date: Tue, 14 Apr 2020 13:31:29 +0200 Subject: podmanV2: implement build Implement `podman build` for the local client. The remote client will require some rather large work in the backend and a new build endpoint for the libpod rest API. Signed-off-by: Valentin Rothberg --- cmd/podman/utils/utils.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 cmd/podman/utils/utils.go (limited to 'cmd/podman/utils/utils.go') diff --git a/cmd/podman/utils/utils.go b/cmd/podman/utils/utils.go new file mode 100644 index 000000000..c7d105ba4 --- /dev/null +++ b/cmd/podman/utils/utils.go @@ -0,0 +1,22 @@ +package utils + +import "os" + +// IsDir returns true if the specified path refers to a directory. +func IsDir(path string) bool { + file, err := os.Stat(path) + if err != nil { + return false + } + return file.IsDir() +} + +// FileExists returns true if path refers to an existing file. +func FileExists(path string) bool { + file, err := os.Stat(path) + // All errors return file == nil + if err != nil { + return false + } + return !file.IsDir() +} -- cgit v1.2.3-54-g00ecf