golang-shell

module
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2022 License: MIT

README

golang-shell

Go Reference CI codecov

Fluent interface to spawn processes in Go.

Basic Example
package main

import (
    "fmt"

    "github.com/ibrt/golang-shell/shellz"
)

func main() {
    // Pipe "ls" output to terminal.
    shellz.NewCommand("ls", ".").MustRun()

    out := shellz.NewCommand("/usr/bin/env", "bash", "-c").
        AddParams("echo $MY_VAR").
        SetEnv("MY_VAR", "my-var").
        MustOutput()

    // Will output: "my-var".
    fmt.Println(out)
}
Developers

Contributions are welcome, please check in on proposed implementation before sending a PR. You can validate your changes using the ./test.sh script.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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