first commit
This commit is contained in:
22
config/filesystem.go
Normal file
22
config/filesystem.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
)
|
||||
|
||||
var defaultPathDataFolder string = ""
|
||||
var defaultPathUploadFolder string = ""
|
||||
|
||||
func gatherDefaultPaths() error {
|
||||
execPath, err := os.Executable()
|
||||
if err != nil {
|
||||
return fmt.Errorf("[Error] Could not determine binary path: %v", err)
|
||||
}
|
||||
|
||||
defaultPathDataFolder = filepath.Join(filepath.Dir(execPath), DefaultNameDataFolder)
|
||||
defaultPathUploadFolder = filepath.Join(defaultPathDataFolder, DefaultNameUploadFolder)
|
||||
|
||||
return nil
|
||||
}
|
Reference in New Issue
Block a user