lift

package module
v0.0.0-...-cc70ed6 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2021 License: MIT Imports: 9 Imported by: 0

README

lift

lift is a simple command line tool that run shell script under project hierarchy.

You can invoke lift command anywhere under your project, since it find LiftFile from working directory to file system root.

lift are designed to be the entry point of your development toolchains. It provides following benefits:

  • Run commands any where under project directory.
  • Prepare environment for internal commands.

LiftFile

LiftFile is just a shell script which we will run using native go interpreter(mvdan/sh).

life provides follwing environment variables that can be used in LiftFile.

  • LIFT_WD: working directory which is where lift be invoked.
  • LIFT_FILE: LiftFile location.
  • LIFT_FOLDER: the containing folder of LiftFile.

Use Cases

Run node script in project root
#!/usr/bin/env bash

node $LIFT_FOLDER/scripts/entrypoint.js

Documentation

Index

Constants

View Source
const (
	LiftFileName = `LiftFile`
)

Variables

This section is empty.

Functions

This section is empty.

Types

type LiftOption

type LiftOption func(opt *liftOption)

func WithCWD

func WithCWD(cwd string) LiftOption

func WithLiftFile

func WithLiftFile(filename string) LiftOption

func WithLogger

func WithLogger(logger Logger) LiftOption

type Lifter

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

func New

func New(options ...LiftOption) *Lifter

func (*Lifter) Run

func (lift *Lifter) Run(ctx context.Context) (status int, err error)

type Logger

type Logger interface {
	Printf(format string, args ...interface{})
}

type WriteLogger

type WriteLogger struct {
	io.Writer
	Prefix string
}

func (WriteLogger) Printf

func (w WriteLogger) Printf(format string, args ...interface{})

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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