func DirExists(dir string) bool {
	if strings.HasPrefix(dir, "~") {
		dir = path.Join(HomeDir, strings.Trim(dir, "~"))
	}
	src, err := os.Stat(dir)
	if err != nil {
		return false
	}
	return src.IsDir()
}
DirExists returns true if the given param is a valid existing directory
package util
import (
	"flag"
	"fmt"
	"io"
	"io/ioutil"
	"net/http"
	"os"
	"os/exec"
	"path"
	"strings"
	"time"
	"github.com/leopardslab/dunner/internal/logger"
)
var log = logger.Log
var HomeDir = os.Getenv("HOME")
var userDir = os.Getenv("user")
type progressReader struct {
	io.Reader
	bytesTransfered   int64
	totalBytes        int64
	progress          float64
	progressDisplayed bool
}
func (w *progressReader) Read(p []byte) (int, error) {
	n, err := w.Reader.Read(p)
	if n > 0 {
		w.bytesTransfered += int64(n)
		percent := float64(w.bytesTransfered) * float64(100) / float64(w.totalBytes)
		if percent-w.progress > 4 {
			fmt.Print(".")
			w.progress = percent
			w.progressDisplayed = true
		}
	}
	return n, err
}