summaryrefslogtreecommitdiffstats
path: root/helpers/path.go
diff options
context:
space:
mode:
Diffstat (limited to 'helpers/path.go')
-rw-r--r--helpers/path.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/helpers/path.go b/helpers/path.go
index 44d53d018..0a8544357 100644
--- a/helpers/path.go
+++ b/helpers/path.go
@@ -154,11 +154,16 @@ func ReplaceExtension(path string, newExt string) string {
// AbsPathify creates an absolute path if given a relative path. If already
// absolute, the path is just cleaned.
func (p *PathSpec) AbsPathify(inPath string) string {
+ return AbsPathify(p.workingDir, inPath)
+}
+
+// AbsPathify creates an absolute path if given a working dir and arelative path.
+// If already absolute, the path is just cleaned.
+func AbsPathify(workingDir, inPath string) string {
if filepath.IsAbs(inPath) {
return filepath.Clean(inPath)
}
-
- return filepath.Join(p.workingDir, inPath)
+ return filepath.Join(workingDir, inPath)
}
// GetLayoutDirPath returns the absolute path to the layout file dir