Go to file
abs3nt 0279e65cee
ci/woodpecker/push/woodpecker Pipeline was successful Details
ci/woodpecker/tag/woodpecker Pipeline was successful Details
version bump
2023-03-05 23:48:13 -08:00
cmd version bump 2023-03-05 23:48:13 -08:00
src clean 2023-03-05 23:39:01 -08:00
.githubrelease.yaml ci: fix github build 2023-03-04 23:44:28 -08:00
.gitignore fix: remove binary 2023-03-05 22:18:46 -08:00
.goreleaser.yaml ci: build changes 2023-03-04 23:42:01 -08:00
.woodpecker.yml ci: build changes 2023-03-04 23:42:01 -08:00
LICENSE initial commit 2023-03-04 14:22:03 -08:00
Makefile initial commit 2023-03-04 14:22:03 -08:00
README.md docs: update docs 2023-03-05 23:47:02 -08:00
go.mod initial commit 2023-03-04 14:22:03 -08:00
go.sum initial commit 2023-03-04 14:22:03 -08:00
main.go initial commit 2023-03-04 14:22:03 -08:00

README.md

Quickstart

go install github.com/abs3ntdev/haunt@latest

or

git clone https://github.com/abs3ntdev/haunt
cd haunt
make build && sudo make install

Commands List

Init Command

This command will generate a .haunt.yaml with sane default for your current project/projects.
If there is a main.go in the root directory it will be added along with any directories inside the relative path cmd

haunt init

Run Command

haunt run

the run command allows for specifying projects by name, all provided will be ran according to the config file:

Some examples:

haunt run
haunt run server api

Add Command

Add a project, the same defaults init uses will be used for new projects unless flags are provided.

haunt add [name] [--flags]

Possible flags are:

-b, --build         Enable go build
-f, --fmt           Enable go fmt
-g, --generate      Enable go generate
-h, --help          help for add
-i, --install       Enable go install (default true)
-p, --path string   Project base path (default "./")
-r, --run           Enable go run (default true)
-t, --test          Enable go test
-v, --vet           Enable go vet

Remove Command

Remove a project by its name

haunt remove [name]

Config sample

settings:
    legacy:
        force: true             // force polling watcher instead fsnotifiy
        interval: 100ms         // polling interval
    resources:                  // files names
        outputs: outputs.log
        logs: logs.log
        errors: errors.log
server:
    status: false               // server status
    open: false                 // open browser at start
    host: localhost             // server host
    port: 5001                  // server port
schema:
- name: coin
  path: cmd/coin                // project path
  env:            // env variables available at startup
        test: test
        myvar: value
  commands:               // go commands supported
    vet:
        status: true
    fmt:
        status: true
        args:
        - -s
        - -w
    test:
        status: true
        method: gb test    // support different build tools
    generate:
        status: true
    install:
        status: true
    build:
        status: false
        method: gb build    // support differents build tool
        args:               // additional params for the command
        - -race
    run:
        status: true
  args:                     // arguments to pass at the project
  - --myarg
  watcher:
      paths:                 // watched paths are relative to directory you run haunt in
      - src
      - cmd/coin
      ignore_paths:          // ignored paths
      - vendor
      extensions:                  // watched extensions
      - go
      - html
      scripts:
      - type: before
        command: echo before global
        global: true
        output: true
      - type: before
        command: echo before change
        output: true
      - type: after
        command: echo after change
        output: true
      - type: after
        command: echo after global
        global: true
        output: true