1
0
mirror of https://github.com/go-task/task.git synced 2025-11-23 22:24:45 +02:00

improvements on release process

This commit is contained in:
Andrey Nering
2017-06-14 15:28:35 -03:00
parent e97fd65cd3
commit 685b9ae293
3 changed files with 40 additions and 4 deletions

View File

@@ -9,6 +9,10 @@ import (
"github.com/spf13/pflag"
)
var (
version = "master"
)
func main() {
log.SetFlags(0)
@@ -30,16 +34,23 @@ hello:
}
var (
init bool
force bool
watch bool
versionFlag bool
init bool
force bool
watch bool
)
pflag.BoolVar(&versionFlag, "version", false, "show Task version")
pflag.BoolVarP(&init, "init", "i", false, "creates a new Taskfile.yml in the current folder")
pflag.BoolVarP(&force, "force", "f", false, "forces execution even when the task is up-to-date")
pflag.BoolVarP(&watch, "watch", "w", false, "enables watch of the given task")
pflag.Parse()
if versionFlag {
log.Printf("Task version: %s\n", version)
return
}
if init {
if err := task.InitTaskfile(); err != nil {
log.Fatal(err)