1
0
mirror of https://github.com/go-task/task.git synced 2025-04-18 12:04:04 +03:00

refactor: embed the default Taskfile instead of defining it in code (#2112)

This commit is contained in:
Pete Davison 2025-03-11 13:53:08 +00:00 committed by GitHub
parent 076aff1f8e
commit d1360ee72a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 16 additions and 14 deletions

18
init.go
View File

@ -1,28 +1,18 @@
package task
import (
_ "embed"
"os"
"github.com/go-task/task/v3/errors"
"github.com/go-task/task/v3/internal/filepathext"
)
const DefaultTaskfile = `# https://taskfile.dev
version: '3'
vars:
GREETING: Hello, World!
tasks:
default:
cmds:
- echo "{{.GREETING}}"
silent: true
`
const defaultTaskFilename = "Taskfile.yml"
//go:embed taskfile/templates/default.yml
var DefaultTaskfile string
// InitTaskfile creates a new Taskfile at path.
//
// path can be either a file path or a directory path.

View File

@ -0,0 +1,12 @@
# https://taskfile.dev
version: '3'
vars:
GREETING: Hello, World!
tasks:
default:
cmds:
- echo "{{.GREETING}}"
silent: true