From 6817f494ef758e4b273e994a55dedf03c9df70bc Mon Sep 17 00:00:00 2001 From: cupcakearmy Date: Sun, 31 Oct 2021 22:32:01 +0100 Subject: [PATCH] util to check if volume exists --- internal/utils.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/utils.go b/internal/utils.go index 7756677..52172c8 100644 --- a/internal/utils.go +++ b/internal/utils.go @@ -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 +}