From 78cc81902926641e1e253d7f2ed154960605c38f Mon Sep 17 00:00:00 2001 From: maddalax Date: Fri, 13 Sep 2024 19:25:31 -0500 Subject: [PATCH] woops --- framework/tooling/mhtml/Taskfile.yml | 65 ---------------------------- framework/tooling/mhtml/go.mod | 3 -- framework/tooling/mhtml/runner.go | 58 ------------------------- setup.md | 3 +- 4 files changed, 2 insertions(+), 127 deletions(-) delete mode 100644 framework/tooling/mhtml/Taskfile.yml delete mode 100644 framework/tooling/mhtml/go.mod delete mode 100644 framework/tooling/mhtml/runner.go diff --git a/framework/tooling/mhtml/Taskfile.yml b/framework/tooling/mhtml/Taskfile.yml deleted file mode 100644 index abf5fef..0000000 --- a/framework/tooling/mhtml/Taskfile.yml +++ /dev/null @@ -1,65 +0,0 @@ -version: '3' - -interval: 500ms - -tasks: - - template: - dir: '{{.USER_WORKING_DIR}}' - desc: Generate template from source code - cmds: - - go run github.com/maddalax/htmgo/framework/tooling/downloadtemplate@latest -out my-app - - echo "Template generated successfully to ./my-app" - - setup: - deps: [copy-framework-assets, ast] - dir: '{{.USER_WORKING_DIR}}' - desc: Setup the project - cmds: - - go mod download - - go mod tidy - - run: - dir: '{{.USER_WORKING_DIR}}' - desc: Run the project - cmds: - - task: setup - dir: '{{.USER_WORKING_DIR}}' - - go run . - - build: - deps: [setup] - dir: '{{.USER_WORKING_DIR}}' - desc: Build the project - cmds: - - rm -rf ./dist - - mkdir -p ./dist/assets/dist - - cp -r ./assets/dist/* ./dist/assets/dist/ - - go build -o "./dist" . - - echo "Build successful" - - copy-framework-assets: - dir: '{{.USER_WORKING_DIR}}' - desc: Copy framework assets - cmds: - - go run github.com/maddalax/htmgo/framework/tooling/copyassets@latest - - ast: - dir: '{{.USER_WORKING_DIR}}' - desc: Generate AST from source code - generates: - - '**/generated.go' - cmds: - - go run github.com/maddalax/htmgo/framework/tooling/astgen@latest - - ast-watch: - dir: '{{.USER_WORKING_DIR}}' - desc: Generate AST from source code and watch for changes - watch: true - generates: - - '**/generated.go' - sources: - - '**/*.go' - cmds: - - task: ast - dir: '{{.USER_WORKING_DIR}}' \ No newline at end of file diff --git a/framework/tooling/mhtml/go.mod b/framework/tooling/mhtml/go.mod deleted file mode 100644 index f376e8a..0000000 --- a/framework/tooling/mhtml/go.mod +++ /dev/null @@ -1,3 +0,0 @@ -module github.com/maddalax/htmgo/framework/tooling/htmgo - -go 1.23.0 \ No newline at end of file diff --git a/framework/tooling/mhtml/runner.go b/framework/tooling/mhtml/runner.go deleted file mode 100644 index 5372cce..0000000 --- a/framework/tooling/mhtml/runner.go +++ /dev/null @@ -1,58 +0,0 @@ -package main - -import ( - _ "embed" - "flag" - "fmt" - "os" - "os/exec" -) - -//go:embed Taskfile.yml -var taskFile string - -func main() { - taskFlag := flag.String("task", "", "Specify the task to run (e.g., build, setup). Type -task list to see the list of tasks to run.") - - // Parse the command-line flags - flag.Parse() - - install := exec.Command("go", "install", "github.com/go-task/task/v3/cmd/task@latest") - install.Stdout = os.Stdout - install.Stderr = os.Stderr - err := install.Run() - if err != nil { - fmt.Printf("Error installing task: %v\n", err) - return - } - - temp, err := os.CreateTemp("", "Taskfile.yml") - - if err != nil { - fmt.Printf("Error creating temporary file: %v\n", err) - return - } - - os.WriteFile(temp.Name(), []byte(taskFile), 0644) - - if *taskFlag == "" { - fmt.Println("Please specify a task to run using the -task flag") - return - } - - if *taskFlag == "list" { - *taskFlag = "--list" - } - - // Define the command and arguments - cmd := exec.Command("task", "-t", temp.Name(), *taskFlag) - // Set the standard output and error to be the same as the Go program - cmd.Stdout = os.Stdout - cmd.Stderr = os.Stderr - // Run the command - err = cmd.Run() - if err != nil { - fmt.Printf("Error running task command: %v\n", err) - return - } -} diff --git a/setup.md b/setup.md index 37eb738..dfb5a85 100644 --- a/setup.md +++ b/setup.md @@ -1 +1,2 @@ -go run github.com/maddalax/htmgo/framework/tooling/htmgo@latest -task template \ No newline at end of file +go install github.com/maddalax/htmgo/framework/tooling/htmgo@latest +go run htmgo -task template \ No newline at end of file