1
0
mirror of https://github.com/go-task/task.git synced 2025-11-29 22:48:03 +02:00

Add --init flag to create a new Taskfile

This commit is contained in:
Andrey Nering
2017-05-17 15:38:46 -03:00
parent 83f1b213fa
commit 2615000609
6 changed files with 59 additions and 1 deletions

View File

@@ -18,6 +18,8 @@ var (
// TaskFilePath is the default Taskfile
TaskFilePath = "Taskfile"
// Init (--init or -f flag) creates a Taskfile.yml in the current folder if not exists
Init bool
// Force (--force or -f flag) forces a task to run even when it's up-to-date
Force bool
// Watch (--watch or -w flag) enables watch of a task
@@ -46,6 +48,12 @@ func Run() {
log.SetFlags(0)
args := pflag.Args()
if Init {
initTaskfile()
return
}
if len(args) == 0 {
log.Println("task: No argument given, trying default task")
args = []string{"default"}