nix-shell: Better error message when the shell can't be started

This commit is contained in:
Eelco Dolstra 2017-02-24 17:25:00 +01:00
parent e76df9bd52
commit d3e1aad421
No known key found for this signature in database
GPG Key ID: 8170B4726D7198DE
1 changed files with 4 additions and 2 deletions

View File

@ -448,15 +448,17 @@ int main(int argc, char ** argv)
auto envPtrs = stringsToCharPtrs(envStrs);
auto shell = getEnv("NIX_BUILD_SHELL", "bash");
environ = envPtrs.data();
auto argPtrs = stringsToCharPtrs(args);
restoreSignals();
execvp(getEnv("NIX_BUILD_SHELL", "bash").c_str(), argPtrs.data());
execvp(shell.c_str(), argPtrs.data());
throw SysError("executing shell");
throw SysError("executing shell %s", shell);
}
// Ugly hackery to make "nix-build -A foo.all" produce symlinks