api/pkg/path/helpers.go
Peter Kurfer 63a446d7e5
Prepare systemd deployment
- 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
2020-04-12 00:09:30 +02:00

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()
}