fix: replace all get current path method from "./" to os args
This commit is contained in:
@@ -21,10 +21,11 @@ import (
|
||||
)
|
||||
|
||||
func main() {
|
||||
global.CurrentPath = utils.GetCurrentPath()
|
||||
postLog.Info(fmt.Sprintf("%s %s (Build %d.%s) by %s", global.Software.Name, global.Software.Version, global.Software.BuildVer, global.Software.BuildType, global.Software.Developer))
|
||||
global.ConfigPath = flag.String("config", "./config.json", "path to config file")
|
||||
global.DBPath_data = flag.String("db", "./database.db", "path to database file")
|
||||
global.DBPath_log = flag.String("log", "./logs.db", "path to logs database file")
|
||||
global.ConfigPath = flag.String("config", global.CurrentPath+string(os.PathSeparator)+"config.json", "path to config file")
|
||||
global.DBPath_data = flag.String("db", global.CurrentPath+string(os.PathSeparator)+"database.db", "path to database file")
|
||||
global.DBPath_log = flag.String("log", global.CurrentPath+string(os.PathSeparator)+"logs.db", "path to logs database file")
|
||||
flag.Parse()
|
||||
|
||||
if _, err := os.Stat(*global.ConfigPath); os.IsNotExist(err) {
|
||||
@@ -66,8 +67,6 @@ func main() {
|
||||
frpLogger.SetDatabase(global.ConfigDB, global.FrpcDB)
|
||||
frpLogger.SetDebugMode(global.CurrentConfig.Debug)
|
||||
|
||||
config.GetConfig()
|
||||
|
||||
postLog.InitLogBroadcaster()
|
||||
|
||||
setupRoutes()
|
||||
|
||||
Reference in New Issue
Block a user