Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/nix-community/patsh

A command-line tool for patching shell scripts inspired by resholve [maintainer=@figsoda]
https://github.com/nix-community/patsh

bash dependencies dependency nix nixpkgs patch patchelf rust shell

Last synced: about 11 hours ago
JSON representation

A command-line tool for patching shell scripts inspired by resholve [maintainer=@figsoda]

Awesome Lists containing this project

README

        

# patsh

[![version](https://img.shields.io/crates/v/patsh?logo=rust&style=flat-square)](https://crates.io/crates/patsh)
[![deps](https://deps.rs/repo/github/nix-community/patsh/status.svg?style=flat-square&compact=true)](https://deps.rs/repo/github/nix-community/patsh)
[![license](https://img.shields.io/badge/license-MPL--2.0-blue?style=flat-square)](https://www.mozilla.org/en-US/MPL/2.0)
[![ci](https://img.shields.io/github/actions/workflow/status/nix-community/patsh/ci.yml?label=ci&logo=github-actions&style=flat-square)](https://github.com/nix-community/patsh/actions?query=workflow:ci)

A command-line tool for patching shell scripts inspired by [resholve](https://github.com/abathur/resholve)

```sh
nix run github:nix-community/patsh -- -f script.sh
```

## Usage

```
Usage: patsh [OPTIONS] [OUTPUT]

Arguments:
the file to be patched
[OUTPUT] output path of the patched file, defaults to the input path, however, --force is required to patch in place

Options:
-b, --bash bash command used to list the built-in commands [default: bash]
-f, --force remove existing output file if needed
-p, --path use something other than the PATH variable for path resolution
-s, --store-dir path to the nix store, e.g. `builtins.storeDir` [default: /nix/store]
-h, --help Print help information
-V, --version Print version information
```

## TODO

- ansi-c quoting
- resolving variables
- diagnostics for unresolved commands

## Changelog

See [CHANGELOG.md](CHANGELOG.md)