util to check if volume exists

This commit is contained in:
cupcakearmy 2021-10-31 22:32:01 +01:00
parent 2c46f0da0c
commit 6817f494ef
No known key found for this signature in database
GPG Key ID: D28129AE5654D9D9

View File

@ -77,3 +77,9 @@ func CopyFile(from, to string) error {
} }
return nil return nil
} }
func CheckIfVolumeExists(volume string) bool {
out, err := ExecuteCommand(ExecuteOptions{Command: "docker"}, "volume", "inspect", volume)
fmt.Println(out)
return err == nil
}