fixed the default config and some other stuff idk
This commit is contained in:
parent
51f01af6d8
commit
dcc3c10bb3
3 changed files with 18 additions and 14 deletions
7
main.go
7
main.go
|
|
@ -19,16 +19,17 @@ func handleConfig() {
|
|||
if os.IsNotExist(folder) {
|
||||
os.Mkdir(filepath.Dir(data.GetConfigFile()), os.ModePerm)
|
||||
}
|
||||
|
||||
defaultconfig := "println green neOwOfetchh 🔥\ninfo white username\nprint blue @\ninfoln blue hostname\nprint white uptime: \ninfoln red uptime\nprint white shell: \ninfoln blue shell\nprint white distro: \ninfoln blue distro\nprint white terminal: \ninfoln blue terminal\nprint white memory: \ninfo blue memoryUsed\nprint white /\ninfoln blue memoryAll"
|
||||
if os.IsNotExist(file) {
|
||||
println("config was not found. a default config file has been generated in '~/.config/neowofetch/conf'. rerun the program")
|
||||
f, _ := os.Create(data.GetConfigFile())
|
||||
_, _ = f.WriteString("println green neOwOfetch 🔥\ninfo white username\nprint blue @\ninfoln blue hostname\nprint white uptime: \ninfoln red uptime\nprint white shell: \ninfoln blue shell\nprint white distro: \ninfoln blue distro\nprint white terminal: \ninfoln blue terminal\nprint white memory: \ninfo blue memoryUsed\nprint white /\ninfoln blue memoryAll")
|
||||
_, _ = f.WriteString(defaultconfig)
|
||||
os.Exit(0)
|
||||
} else {
|
||||
body, _ := ioutil.ReadFile(data.GetConfigFile())
|
||||
sbody := (string(body))
|
||||
if utils.Defaultconf {
|
||||
sbody = "println green neOwOfetchh 🔥\ninfo white username\nprint blue @\ninfoln blue hostname\nprint white uptime: \ninfoln red uptime\nprint white shell: \ninfoln blue shell\nprint white distro: \ninfoln blue distro\nprint white terminal: \ninfoln blue terminal\nprint white memory: \ninfo blue memoryUsed\nprint white /\ninfoln blue memoryAll"
|
||||
sbody = defaultconfig
|
||||
}
|
||||
fbody := strings.Split(sbody, "\n")
|
||||
for _, line := range fbody {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue