summaryrefslogtreecommitdiff
path: root/pkg/specgen/winpath_windows.go
blob: c6aad314a22bac6f2fb7e6587e479576c4d1e2b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package specgen

import (
	"github.com/sirupsen/logrus"
	"os"
	"path/filepath"
)

func shouldResolveUnixWinVariant(path string) bool {
	return true
}

func shouldResolveWinPaths() bool {
	return true
}

func resolveRelativeOnWindows(path string) string {
	ret, err := filepath.Abs(path)
	if err != nil {
		logrus.Debugf("problem resolving possible relative path %q: %s", path, err.Error())
		return path
	}

	return ret
}

func winPathExists(path string) bool {
	_, err := os.Stat(path)
	return err == nil
}