ali path and link

This commit is contained in:
微凉
2021-10-28 22:50:09 +08:00
parent 98f7dffed9
commit 0a50fbd080
13 changed files with 207 additions and 41 deletions

View File

@ -7,6 +7,7 @@ import (
"io/ioutil"
"os"
"path/filepath"
"strings"
)
// Exists determine whether the file exists
@ -75,4 +76,12 @@ func WriteToJson(src string, conf interface{}) bool {
return false
}
return true
}
func ParsePath(path string) string {
path = strings.TrimRight(path, "/")
if !strings.HasPrefix(path, "/") {
path = "/" + path
}
return path
}