mirror of
https://github.com/podman-container-tools/podman.git
synced 2026-08-12 20:05:48 +00:00
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 <rothberg@redhat.com>
22 lines
433 B
Go
22 lines
433 B
Go
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()
|
|
}
|