tash

command module
v0.0.0-...-8c3fd4b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 13, 2020 License: MIT Imports: 32 Imported by: 0

README

Tash

Tash is a yaml based shell for task running.

Goals

simple, declarative, cross-platform, doesn't depends on unix shell or makefile.

Install

  • With go installed: go get github.com/zhuah/tash
  • Prebuilt binaries: TODO.

Configuration file location

by default, tash will lookup tash.yaml under current/ancestor directories, or user can use -c/--conf option.

Usage

  • list tasks: tash or tash list [TASK]... [-a/--args]
  • run tasks: tash TASK_NAME... [-d/--debug]
  • show help: tash -h

Example

  • building tash itself
templates:
  build:
    - condition:
        value: $GOOS
        compare: windows
        actions:
          - env:
              value: EXECUTABLE_EXT=.exe
    - cmd:
        exec: go build -ldflags "-w -s" -o tash_${GOOS}_${GOARCH}$EXECUTABLE_EXT

tasks:
  native:
    description: |-
      build native binary
    actions:
      - cmd:
          exec: go build -ldflags "-w -s"

  darwin:
    description: |-
      build darwin binary
    args:
      - env: GOARCH
        description: build architecture, amd64 or 386
        default: amd64
    actions:
      - env:
          value: GOOS=darwin
      - template: build

  linux:
    description: |-
      build linux binary
    args:
      - env: GOARCH
        description: build architecture, amd64 or 386
        default: amd64
    actions:
      - env:
          value: GOOS=linux
      - template: build

  windows:
    description: |-
      build windows binary
    args:
      - env: GOARCH
        description: build architecture, amd64 or 386
        default: amd64
    actions:
      - env:
          value: GOOS=windows
      - template: build
  all:
    description: |-
      build darwin,linux,windows binary
    actions:
      - task:
          name: darwin
      - task:
          name: linux
      - task:
          name: windows

  watch:
    description: |-
      watch fs changes and build native binary
    actions:
      - watch:
          dirs: [.]
          files: [./*.go]
          actions:
            - task:
                name: native

Configuration Syntax

defined in syntax folder.

License

MIT.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL