nix develop: Preserve stdin with -c
This commit is contained in:
parent
387f824cab
commit
fb7735e4cf
|
@ -474,9 +474,9 @@ struct CmdDevelop : Common, MixEnvironment
|
||||||
ignoreException();
|
ignoreException();
|
||||||
}
|
}
|
||||||
|
|
||||||
// If running a phase, don't want an interactive shell running after
|
// If running a phase or single command, don't want an interactive shell running after
|
||||||
// Ctrl-C, so don't pass --rcfile
|
// Ctrl-C, so don't pass --rcfile
|
||||||
auto args = phase ? Strings{std::string(baseNameOf(shell)), rcFilePath}
|
auto args = phase || !command.empty() ? Strings{std::string(baseNameOf(shell)), rcFilePath}
|
||||||
: Strings{std::string(baseNameOf(shell)), "--rcfile", rcFilePath};
|
: Strings{std::string(baseNameOf(shell)), "--rcfile", rcFilePath};
|
||||||
|
|
||||||
restoreAffinity();
|
restoreAffinity();
|
||||||
|
|
|
@ -58,6 +58,7 @@ output=$($TEST_ROOT/shell.shebang.rb abc ruby)
|
||||||
|
|
||||||
# Test 'nix develop'.
|
# Test 'nix develop'.
|
||||||
nix develop -f shell.nix shellDrv -c bash -c '[[ -n $stdenv ]]'
|
nix develop -f shell.nix shellDrv -c bash -c '[[ -n $stdenv ]]'
|
||||||
|
echo foo | nix develop -f shell.nix shellDrv -c cat # preserve stdin with `-c`
|
||||||
|
|
||||||
# Test 'nix print-dev-env'.
|
# Test 'nix print-dev-env'.
|
||||||
source <(nix print-dev-env -f shell.nix shellDrv)
|
source <(nix print-dev-env -f shell.nix shellDrv)
|
||||||
|
|
Loading…
Reference in a new issue