File tree Expand file tree Collapse file tree 3 files changed +34
-29
lines changed
Expand file tree Collapse file tree 3 files changed +34
-29
lines changed Original file line number Diff line number Diff line change 2222# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2323# SOFTWARE.
2424
25- VERSION=" 0.9.2 "
25+ VERSION=" 0.10.0a1 "
2626USAGE=" bash-env-json [--help] [--shellfns <comma-separated-function-names>] [path]"
2727
2828shopt -s extglob
Original file line number Diff line number Diff line change 1313 pkgs = import nixpkgs {
1414 inherit system ;
1515 } ;
16- bash-env-json =
17- let
18- inherit ( pkgs ) bash coreutils gnused jq makeWrapper writeShellScriptBin ;
19- inherit ( pkgs . lib ) makeBinPath ;
20-
21- substFullPaths = program_package :
22- let replaceList = pkgs . lib . attrsets . mapAttrsToList ( name : pkg : { from = " ${ name } " ; to = " ${ pkg } /bin/${ name } " ; } ) program_package ; in
23- builtins . replaceStrings ( map ( x : x . from ) replaceList ) ( map ( x : x . to ) replaceList ) ;
24-
25- in
26- ( writeShellScriptBin "bash-env-json"
27- ( substFullPaths
28- {
29- env = pkgs . coreutils ;
30- jq = pkgs . jq ;
31- mktemp = pkgs . coreutils ;
32- rm = pkgs . coreutils ;
33- sed = pkgs . gnused ;
34- touch = pkgs . coreutils ;
35- }
36- ( builtins . readFile ./bash-env-json ) ) ) . overrideAttrs ( old : {
37- buildInputs = [ bash ] ;
38- buildCommand =
39- ''
40- ${ old . buildCommand }
41- patchShebangs $out
42- '' ;
43- } ) ;
16+ bash-env-json = import ./package.nix pkgs ;
4417 in
4518 {
4619 devShells =
Original file line number Diff line number Diff line change 1+ { lib
2+ , bash
3+ , coreutils
4+ , gnused
5+ , jq
6+ , writeShellScriptBin
7+ , ...
8+ } :
9+ let
10+ substFullPaths = program_package :
11+ let replaceList = lib . attrsets . mapAttrsToList ( name : pkg : { from = " ${ name } " ; to = " ${ pkg } /bin/${ name } " ; } ) program_package ; in
12+ builtins . replaceStrings ( map ( x : x . from ) replaceList ) ( map ( x : x . to ) replaceList ) ;
13+
14+ in
15+ ( writeShellScriptBin "bash-env-json"
16+ ( substFullPaths
17+ {
18+ env = coreutils ;
19+ jq = jq ;
20+ mktemp = coreutils ;
21+ rm = coreutils ;
22+ sed = gnused ;
23+ touch = coreutils ;
24+ }
25+ ( builtins . readFile ./bash-env-json ) ) ) . overrideAttrs ( old : {
26+ buildInputs = [ bash ] ;
27+ buildCommand =
28+ ''
29+ ${ old . buildCommand }
30+ patchShebangs $out
31+ '' ;
32+ } )
You can’t perform that action at this time.
0 commit comments