-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
35 lines (27 loc) · 657 Bytes
/
Copy pathmain.go
File metadata and controls
35 lines (27 loc) · 657 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package main
import (
"fmt"
"os"
"github.com/bladeacer/mns/cmd"
"github.com/bladeacer/mns/config"
"github.com/bladeacer/mns/internal/confighandler"
)
func main() {
euid := os.Geteuid()
// Check if the effective user ID is 0 (which indicates root).
if euid == 0 {
fmt.Println("Warning: mnemosync should not be run as root.")
os.Exit(1)
}
appConfig, err := confighandler.LoadConfig()
dataStore, err2 := config.LoadDataStore()
if err != nil {
fmt.Printf("Error loading configuration: %v\n", err)
os.Exit(1)
}
if err2 != nil {
fmt.Printf("Error loading database: %v\n", err2)
os.Exit(1)
}
cmd.Execute(appConfig, dataStore)
}