1
0
mirror of https://github.com/drakkan/sftpgo.git synced 2025-11-23 22:04:50 +02:00

add version info

This commit is contained in:
Nicola Murino
2019-08-08 10:01:33 +02:00
parent 2aca4479a5
commit 4f4489d3f1
16 changed files with 160 additions and 29 deletions

View File

@@ -12,12 +12,6 @@ import (
const logSender = "utils"
var (
version = "dev"
commit = ""
date = ""
)
// IsStringInSlice searches a string in a slice and returns true if the string is found
func IsStringInSlice(obj string, list []string) bool {
for _, v := range list {
@@ -76,14 +70,7 @@ func SetPathPermissions(path string, uid int, gid int) {
}
}
// GetAppVersion returns the app version
func GetAppVersion() string {
v := version
if len(commit) > 0 {
v += "-" + commit
}
if len(date) > 0 {
v += "-" + date
}
return v
// GetAppVersion returns VersionInfo struct
func GetAppVersion() VersionInfo {
return versionInfo
}