#shell #nix #patch #bash #command-line-tool #cli

bin+lib patsh

A command-line tool for patching shell scripts

6 releases

0.2.1 Aug 18, 2023
0.2.0 Dec 4, 2022
0.1.3 Nov 27, 2022

#2544 in Command line utilities

Download history 1/week @ 2024-02-13 47/week @ 2024-02-20 23/week @ 2024-02-27

71 downloads per month

MPL-2.0 license

20KB
419 lines

patsh

version deps license ci

A command-line tool for patching shell scripts inspired by resholve

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

Usage

Usage: patsh [OPTIONS] <INPUT> [OUTPUT]

Arguments:
  <INPUT>   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 <COMMAND>    bash command used to list the built-in commands [default: bash]
  -f, --force             remove existing output file if needed
  -p, --path <PATH>       use something other than the PATH variable for path resolution
  -s, --store-dir <PATH>  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

Dependencies

~16–29MB
~593K SLoC