func NamespaceFromPath(path, basedir string) (string, error) {
	var namespace string
	fullpath, err := filepath.Abs(path)
	if err != nil {
		return "", errors.Wrapf(err, "Failed to get full path of file. filename=%s", path)
	}
	fulldir, err := filepath.Abs(basedir)
	if err != nil {
		return "", errors.Wrapf(err, "Failed to get full path of directory. dirname=%s", basedir)
	}
	namespace = strings.Replace(fullpath, fulldir, "", 1)
	namespace = filepath.ToSlash(namespace)
	namespace = yamlExtRegexp.ReplaceAllString(namespace, "")
	if strings.HasPrefix(namespace, "/") {
		namespace = namespace[1:len(namespace)]
	}
	return namespace, nil
}
NamespaceFromPath returns namespace from the given path
package util
import (
	"bufio"
	"io"
	"io/ioutil"
	"os"
	"path/filepath"
	"regexp"
	"sort"
	"strings"
	"github.com/Songmu/prompter"
	"github.com/pkg/errors"
)
var (
	separatorRegExp = regexp.MustCompile(`^#+\s*[-=]{3,}`)
	yamlExtRegexp   = regexp.MustCompile(`\.[yY][aA]?[mM][lL]$`)
)
func CompareStrings(src, dst []string) ([]string, []string) {
	added, deleted := []string{}, []string{}
	ss := map[string]int{}
	for _, s := range src {
		ss[s] = 1
	}
	for _, s := range dst {
		ss[s] += 2
	}
	for k, v := range ss {
		switch v {
		case 1:
			deleted = append(deleted, k)
		case 2:
			added = append(added, k)
		}
	}
	sort.Strings(added)
	sort.Strings(deleted)
	return added, deleted
}
func IsExist(name string) bool {
	_, err := os.Stat(name)
	return err == nil || os.IsExist(err)
}
func IsSecretFile(filename string) bool {
	base := filepath.Base(filename)
	return !strings.HasPrefix(base, ".") && yamlExtRegexp.MatchString(filepath.Ext(base))
}