Started creating the history system

This commit is contained in:
Alexandre 2025-01-29 08:50:16 +01:00
parent 648509cb7e
commit 701b83eda4

26
conf.go Normal file
View File

@ -0,0 +1,26 @@
package main
import (
"fmt"
"os"
)
func main() {
homeDir, err := os.UserHomeDir()
if err != nil {
return
}
if fileExists(homeDir+"/.gosh_history") {
fmt.Println("GoSh History file exists")
} else {
fmt.Println("GoSh History file does not exist")
}
}
func fileExists(filename string) bool {
info, err := os.Stat(filename)
if os.IsNotExist(err) {
return false
}
return !info.IsDir()
}