script
script copied to clipboard
Making it easy to write shell-like scripts in Go
Hi everyone, I am in the final year of a computer science program and one of the classes I am taking this quarter is an Open Source Software class. It’s...
I am trying to write a simple `sed -i` script using this, but it seems that when I run it on the same path that I am reading it from,...
A small update to allow for `exec.Command(name string, arg ...string)` style arguments. ```go script.Exec("go", "help") ```
The Prompt function from PR #199 could be a bit expanded to support message formatting and default values: ```go // Prompt creates a pipe that reads user input from stdin...
Added a method `WithEnv` that takes in a string array (`[]string `) and overrides the environment executing a `exec.Command` to that array. This PR fixes #80.
There was a race condition that existed in `Pipe.Exec`, which spins up a goroutine that access `Pipe.stderr` without a lock. This PR fixes that by protecting `Pipe.stderr` with `Pipe.mu`. This...
Would ExecContext make sense ? This will allow us to cancel long-running commands with the standard go pattern
Some methods to set environment varialbes for single command, instead of this: ```go os.Setenv("XB_AUTHOR_DATE", dateStr) os.Setenv("XB_COMMITTER_DATE", dateStr) ``` Maybe in old shell way: ```bash XB_AUTHOR_DATE="2021-04-05" XB_COMMITTER_DATE="2021-04-05" xb_push xxxx ```
This PR fixes #110 by handling an empty input into the `Slice` function. Added a new unit test ``` ✔ Slice produces elements of specified slice one per line (0.00s)...
In the `Do` function of the `Pipe` object, all HTTP response codes of 2xx are treated as okay. While this is a good generalisation, a possible enhancement could be to...