func ConfirmationPrompt(message string, defaultValue bool) bool {
	confirm := false
	prompt := &survey.Confirm{
		Message: message,
		Default: defaultValue,
	}
	err := survey.AskOne(prompt, &confirm)
	if err != nil {
		if err == terminal.InterruptErr {
			Log("Exiting")
			os.Exit(1)
		}
		HandleError(err)
	}
	return confirm
}
ConfirmationPrompt prompt user to confirm yes/no
package utils
import (
	"errors"
	"fmt"
	"os"
	"os/exec"
	"os/signal"
	"os/user"
	"path/filepath"
	"runtime"
	"strconv"
	"strings"
	"syscall"
	"time"
	"github.com/AlecAivazis/survey/v2"
	"github.com/AlecAivazis/survey/v2/terminal"
	"github.com/atotto/clipboard"
	"github.com/google/uuid"
	"github.com/spf13/cobra"
)
func ConfigDir() string {
	dir, err := os.UserConfigDir()
	if err != nil {
		HandleError(err, "Unable to determine configuration directory")
	}
	return dir
}
func HomeDir() string {
	dir, err := os.UserHomeDir()
	if err != nil {
		HandleError(err, "Unable to determine home directory")
	}
	return dir
}
func ParsePath(path string) (string, error) {
	if path == "" {
		return "", errors.New("Path cannot be blank")
	}
	if strings.HasPrefix(path, "~") {
		firstPath := strings.Split(path, string(filepath.Separator))[0]
		if firstPath != "~" {
			username, err := user.Current()
			if err != nil || firstPath != fmt.Sprintf("~%s", username.Username) {
				return "", fmt.Errorf("unable to parse path, please specify an absolute path (e.g. /home/%s)", path[1:])
			}
		}
		path = strings.Replace(path, firstPath, HomeDir(), 1)
	}
	absolutePath, err := filepath.Abs(filepath.Clean(path))
	if err != nil {
		return "", err
	}
	return absolutePath, nil
}
func Exists(path string) bool {
	if _, err := os.Stat(path); err != nil {
		return false
	}
	return true
}
func Cwd() string {
	cwd, err := os.Getwd()
	if err != nil {
		HandleError(err)
	}
	return cwd
}
func RunCommand(command []string, env []string, inFile *os.File, outFile *os.File, errFile *os.File, forwardSignals bool) (int, error) {
	cmd := exec.Command(command[0], command[1:]...)  
	cmd.Env = env
	cmd.Stdin = inFile
	cmd.Stdout = outFile
	cmd.Stderr = errFile
	return execCommand(cmd, forwardSignals)
}
func RunCommandString(command string, env []string, inFile *os.File, outFile *os.File, errFile *os.File, forwardSignals bool) (int, error) {
	shell := [2]string{"sh", "-c"}
	if IsWindows() {
		shell = [2]string{"cmd", "/C"}
	} else {
		shells := []string{"/bash", "/dash", "/fish", "/zsh", "/ksh", "/csh", "/tcsh"}
		envShell := os.Getenv("SHELL")
		for _, s := range shells {
			if strings.HasSuffix(envShell, s) {
				shell[0] = envShell
				break
			}
		}
	}
	cmd := exec.Command(shell[0], shell[1], command)  
	cmd.Env = env
	cmd.Stdin = inFile
	cmd.Stdout = outFile
	cmd.Stderr = errFile
	return execCommand(cmd, forwardSignals)
}
func execCommand(cmd *exec.Cmd, forwardSignals bool) (int, error) {
	sigChan := make(chan os.Signal, 1)
	signal.Notify(sigChan)
	if err := cmd.Start(); err != nil {
		return 1, err
	}
	go func() {
		for {
			if forwardSignals {
				sig := <-sigChan
				cmd.Process.Signal(sig)  
			} else {
				<-sigChan
			}
		}
	}()
	if err := cmd.Wait(); err != nil {
		cmd.Process.Signal(os.Kill)  
		if exitError, ok := err.(*exec.ExitError); ok {
			return exitError.ExitCode(), exitError
		}
		return 2, err
	}
	waitStatus, ok := cmd.ProcessState.Sys().(syscall.WaitStatus)
	if !ok {
		return 2, fmt.Errorf("Unexpected ProcessState type, expected syscall.WaitStatus, got %T", waitStatus)
	}
	return waitStatus.ExitStatus(), nil
}
func RequireValue(name string, value string) {
	value = strings.TrimSpace(value)
	if value == "" {
		HandleError(fmt.Errorf("you must provide a %s", name))
	}
}
func GetBool(value string, def bool) bool {
	b, err := strconv.ParseBool(value)
	if err != nil {
		return def
	}
	return b
}
func GetBoolFlag(cmd *cobra.Command, flag string) bool {
	b, err := strconv.ParseBool(cmd.Flag(flag).Value.String())
	if err != nil {
		HandleError(err)
	}
	return b
}
func GetBoolFlagIfChanged(cmd *cobra.Command, flag string, def bool) bool {
	if !cmd.Flags().Changed(flag) {
		return def
	}
	return GetBoolFlag(cmd, flag)
}
func GetFlagIfChanged(cmd *cobra.Command, flag string, def string) string {
	if !cmd.Flags().Changed(flag) {
		return def
	}
	return cmd.Flag(flag).Value.String()
}
func GetPathFlagIfChanged(cmd *cobra.Command, flag string, def string) string {
	if !cmd.Flags().Changed(flag) {
		return def
	}
	path, err := ParsePath(cmd.Flag(flag).Value.String())
	if err != nil {
		HandleError(err, "Unable to parse path")
	}
	return path
}
func GetIntFlag(cmd *cobra.Command, flag string, bits int) int {
	number, err := strconv.ParseInt(cmd.Flag(flag).Value.String(), 10, bits)
	if err != nil {
		HandleError(err)
	}
	return int(number)
}
func GetDurationFlag(cmd *cobra.Command, flag string) time.Duration {
	value, err := time.ParseDuration(cmd.Flag(flag).Value.String())
	if err != nil {
		HandleError(err)
	}
	return value
}
func GetDurationFlagIfChanged(cmd *cobra.Command, flag string, def time.Duration) time.Duration {
	if !cmd.Flags().Changed(flag) {
		return def
	}
	return GetDurationFlag(cmd, flag)
}
func GetFilePath(fullPath string) (string, error) {
	if fullPath == "" {
		return "", errors.New("Invalid file path")
	}
	fullPath, err := ParsePath(fullPath)
	if err != nil {
		return "", errors.New("Invalid file path")
	}
	parsedPath := filepath.Dir(fullPath)
	parsedName := filepath.Base(fullPath)
	isNameValid := (parsedName != ".") && (parsedName != "..") && (parsedName != "/") && (parsedName != string(filepath.Separator))
	if !isNameValid {
		return "", errors.New("Invalid file path")
	}
	return filepath.Join(parsedPath, parsedName), nil
}