func checkOutputPath(outpath string, overwrite bool) {
	fi, err := os.Stat(outpath)
	if os.IsNotExist(err) {
		logrus.Debugf("Transformed artifacts will be written to %s", outpath)
		return
	}
	if err != nil {
		logrus.Fatalf("Error while accessing output directory at path %s Error: %q . Exiting", outpath, err)
	}
	if !overwrite {
		logrus.Fatalf("Output directory %s exists. Exiting", outpath)
	}
	if !fi.IsDir() {
		logrus.Fatalf("Output path %s is a file. Expected a directory. Exiting", outpath)
	}
	pwd, err := os.Getwd()
	if err != nil {
		logrus.Fatalf("Failed to get the current working directory. Error: %q", err)
	}
	if common.IsParent(pwd, outpath) {
		logrus.Fatalf("The given output directory %s is a parent of the current working directory.", outpath)
	}
	logrus.Infof("Output directory %s exists. The contents might get overwritten.", outpath)
}
checkOutputPath checks if the output path is already in use.
package main
import (
	"encoding/json"
	"net/http"
	"os"
	"path/filepath"
	"strings"
	"github.com/gorilla/mux"
	"github.com/konveyor/move2kube/common"
	"github.com/konveyor/move2kube/qaengine"
	"github.com/sirupsen/logrus"
	"github.com/spf13/cast"
)
func checkSourcePath(srcpath string) {
	fi, err := os.Stat(srcpath)
	if os.IsNotExist(err) {
		logrus.Fatalf("The given source directory %s does not exist. Error: %q", srcpath, err)
	}
	if err != nil {
		logrus.Fatalf("Error while accessing the given source directory %s Error: %q", srcpath, err)
	}
	if !fi.IsDir() {
		logrus.Fatalf("The given source path %s is a file. Expected a directory. Exiting.", srcpath)
	}
	pwd, err := os.Getwd()
	if err != nil {
		logrus.Fatalf("Failed to get the current working directory. Error: %q", err)
	}
	if common.IsParent(pwd, srcpath) {
		logrus.Fatalf("The given source directory %s is a parent of the current working directory.", srcpath)
	}
}