Merge pull request #14928 from Zaczero/zaczero/nixmain

Remove regex from isNixCommand
This commit is contained in:
Eelco Dolstra
2026-01-06 17:56:41 +00:00
committed by GitHub

View File

@@ -27,7 +27,6 @@
#include "cli-config-private.hh"
#include <sys/types.h>
#include <regex>
#include <nlohmann/json.hpp>
#ifndef _WIN32
@@ -501,7 +500,7 @@ void mainWrapped(int argc, char ** argv)
});
try {
auto isNixCommand = std::regex_search(programName, std::regex("nix$"));
auto isNixCommand = programName.ends_with("nix");
auto allowShebang = isNixCommand && argc > 1;
args.parseCmdline(argvToStrings(argc, argv), allowShebang);
} catch (UsageError &) {