golbs

package module
v0.0.0-...-838417b Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2023 License: MIT Imports: 7 Imported by: 0

README

golbs

Go Build System

Similar to Makefile instead you write your build scripts with Go

Run Tests

cd tests
go build
./tests

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

func Build(opts ...BuildFuncOpt) error

Build accept BuildFuncOpt and retuns an error if any of the BuilderFunc has failed otherwise nil is returned.

func GoBuildYourSelf

func GoBuildYourSelf(buildFile string) (bool, error)

GoBuildYourSelf checks buildFile modification time and decide whether to re-build and run the script or not.

func LiveBuild

func LiveBuild(dir string, builder Builder, cancel chan struct{}) error

LiveBuild live build your project by tracking all go files and check their modification time. then run the builder function once any go file has been changed.

Types

type BuildFuncOpt

type BuildFuncOpt struct {
	FuncName string
	Func     BuilderFunc
}

BuildFuncOpt build options.

type Builder

type Builder func(...BuildFuncOpt) error

Builder function `Build`

type BuilderFunc

type BuilderFunc func() error

BuilderFunc type that represents the build function that we pass into Build function.

type LiveFile

type LiveFile struct {
	Name    string
	ModTime time.Time
}

LiveFiles

type Sh

type Sh struct {
	// contains filtered or unexported fields
}

Sh structure that represents a shell that runs shell commands.

func (*Sh) Error

func (s *Sh) Error() error

Error returns any error that occurs during the process of running the command with Sh.

func (*Sh) In

func (s *Sh) In(inCommand string) *Sh

In accept run command and pass the `inCommand` param into the program via stdin.

func (*Sh) Init

func (s *Sh) Init(command string) *Sh

Init initialize Sh shell. by passing the command that you are going to run.

func (*Sh) Run

func (s *Sh) Run() *Sh

Run Sh method that runs the command provided in Init method.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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