File tree 1 file changed +3
-2
lines changed
nix/overlays/checked-shell-script
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 6
6
, coreutils
7
7
, git
8
8
, lib
9
+ , moreutils
9
10
, runCommand
10
11
, shellcheck
11
12
, stdenv
56
57
# Example: This way `postgrest-watch -h` will return the help output for watch, while
57
58
# `postgrest-watch postgrest-test-spec -h` will return the help output for test-spec.
58
59
# Taken from: https://github.com/matejak/argbash/issues/114#issuecomment-557108274
59
- sed '/_positionals_count + 1/a\\t\t\t\tset -- "'' ${@:1:1}" "--" "'' ${@:2}"' -i $out
60
+ sed '/_positionals_count + 1/a\\t\t\t\tset -- "'' ${@:1:1}" "--" "'' ${@:2}"' $out | ${ moreutils } /bin/sponge $out
60
61
'' ;
61
62
62
63
bash-completion =
66
67
''
67
68
68
69
+ lib . optionalString ( positionalCompletion != "" ) ''
69
- sed 's#COMPREPLY.*compgen -o bashdefault .*$#${ escape positionalCompletion } #' -i $out
70
+ sed 's#COMPREPLY.*compgen -o bashdefault .*$#${ escape positionalCompletion } #' $out | ${ moreutils } /bin/sponge $out
70
71
''
71
72
) ;
72
73
You can’t perform that action at this time.
0 commit comments