reorganized code
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Sebastian Frank
2019-03-18 13:34:52 +01:00
parent 6b34509d9a
commit b2e0d78a2c
120 changed files with 1034 additions and 1067 deletions

View File

@@ -1,6 +1,9 @@
package helper
import "os"
import (
"os"
"strings"
)
// CreateDirectory creates direcory with all missing parents and panic if error
func CreateDirectory(dir string) {
@@ -22,3 +25,14 @@ func CreateDirectory(dir string) {
Log.Panicf("unknown error for output directory '%s': %s", dir, err)
}
}
// BackToRoot builds ../../ string
func BackToRoot(curNavPath string) string {
tmpPath := ""
if curNavPath != "" {
for i := strings.Count(curNavPath, "/") + 1; i > 0; i-- {
tmpPath += "../"
}
}
return tmpPath
}