mirror of
https://github.com/OliveTin/OliveTin
synced 2025-12-12 00:55:34 +00:00
* feature: Exec on calendar file * feature: support for datetime args * feature: Schedule commands based on seconds
21 lines
365 B
Go
21 lines
365 B
Go
package filehelper
|
|
|
|
import (
|
|
log "github.com/sirupsen/logrus"
|
|
"os"
|
|
)
|
|
|
|
func Touch(filename string, description string) {
|
|
_, err := os.Stat(filename)
|
|
|
|
if os.IsNotExist(err) {
|
|
_, err := os.Create(filename)
|
|
|
|
if err != nil {
|
|
log.Warnf("Could not create %v: %v", description, filename)
|
|
} else {
|
|
log.Infof("Created %v: %v", description, filename)
|
|
}
|
|
}
|
|
}
|