util to check if volume exists

This commit is contained in:
2021-10-31 22:32:01 +01:00
parent 2c46f0da0c
commit 6817f494ef

View File

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