From 37c6cf324e645ce0ba01a3127739aacbcecbcb30 Mon Sep 17 00:00:00 2001 From: Jelly Terra Date: Wed, 25 Sep 2024 23:19:43 +0800 Subject: [PATCH] [workflow] Support Tailwind CSS job. --- workflow/builtin/builder.go | 2 +- workflow/builtin/tailwindcss/v1.tmpl | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 workflow/builtin/tailwindcss/v1.tmpl diff --git a/workflow/builtin/builder.go b/workflow/builtin/builder.go index bb7cd20..f43bb82 100644 --- a/workflow/builtin/builder.go +++ b/workflow/builtin/builder.go @@ -6,5 +6,5 @@ package builtin import "embed" -//go:embed tsc/*.tmpl +//go:embed */*.tmpl var Builders embed.FS diff --git a/workflow/builtin/tailwindcss/v1.tmpl b/workflow/builtin/tailwindcss/v1.tmpl new file mode 100644 index 0000000..c324411 --- /dev/null +++ b/workflow/builtin/tailwindcss/v1.tmpl @@ -0,0 +1,6 @@ +{{ if eq .title nil }}{{ panic "missing property: title" }}{{ end }} +{{ if eq .input nil }}{{ panic "missing property: input" }}{{ end }} +{{ if eq .output nil }}{{ panic "missing property: output" }}{{ end }} +{{ job.Set "title" .title }} +{{ job.Set "executable" "tailwindcss" }} +{{ (job.Get "args").Push "--input" (path.Join root .input) "--output" (path.Join root .output) }}