Peter Kurfer
63a446d7e5
- add systemd service - add default file - improve logging to see what kind of errors might occur - ship multiple prepared config files and replace original one with a symlink - fix current working directory getter
26 lines
378 B
Go
26 lines
378 B
Go
package path
|
|
|
|
import (
|
|
"os"
|
|
)
|
|
|
|
func WorkingDirectory() (cwd string) {
|
|
cwd, _ = os.Getwd()
|
|
return
|
|
}
|
|
|
|
func FileExists(filename string) bool {
|
|
info, err := os.Stat(filename)
|
|
if os.IsNotExist(err) {
|
|
return false
|
|
}
|
|
return !info.IsDir()
|
|
}
|
|
|
|
func DirExists(dirPath string) bool {
|
|
info, err := os.Stat(dirPath)
|
|
if os.IsNotExist(err) {
|
|
return false
|
|
}
|
|
return info.IsDir()
|
|
}
|