ppforge/globals/globals.linux.go

25 lines
644 B
Go
Raw Normal View History

2023-10-13 16:13:33 +02:00
package globals
// Global variables, Mocks, etc.
// This package shall not have any dependency towards the application itself!
import (
"log"
"path"
)
func init() {
2023-10-27 13:38:35 +02:00
user, err := MockUserCurrent()
2023-10-13 16:13:33 +02:00
if err != nil {
log.Printf("Current user not obtainable: %s", err)
log.Fatal("Impossible to open default database")
}
// ConfigDirectoryList Configuration directory list Linux
ConfigDirectoryList = []string{user.HomeDir, ".config", "ppforge"}
// ConfigDirectory Configuration directory string Linux
ConfigDirectory = path.Join(ConfigDirectoryList...)
CollectionOfProtocolsDir = path.Join(append(ConfigDirectoryList, "cop")...)
}