nix-shell: don't check for "nix-shell" in shebang script name

This commit is contained in:
Albert Safin 2019-12-14 15:37:20 +00:00
parent ac9cc2ec08
commit a70706b025

View file

@ -106,7 +106,7 @@ static void _main(int argc, char * * argv)
// Heuristic to see if we're invoked as a shebang script, namely, // Heuristic to see if we're invoked as a shebang script, namely,
// if we have at least one argument, it's the name of an // if we have at least one argument, it's the name of an
// executable file, and it starts with "#!". // executable file, and it starts with "#!".
if (runEnv && argc > 1 && !std::regex_search(argv[1], std::regex("nix-shell"))) { if (runEnv && argc > 1) {
script = argv[1]; script = argv[1];
try { try {
auto lines = tokenizeString<Strings>(readFile(script), "\n"); auto lines = tokenizeString<Strings>(readFile(script), "\n");