mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-29 17:16:15 +02:00
Remove tabs
This commit is contained in:
parent
c6fa7775de
commit
c3e9acd1c0
1 changed files with 15 additions and 14 deletions
|
@ -13,30 +13,31 @@ namespace nix::fetchers {
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
RunOptions hgOptions(const Strings & args) {
|
RunOptions hgOptions(const Strings & args)
|
||||||
RunOptions opts("hg", args);
|
{
|
||||||
opts.searchPath = true;
|
RunOptions opts("hg", args);
|
||||||
|
opts.searchPath = true;
|
||||||
|
|
||||||
auto env = getEnv();
|
auto env = getEnv();
|
||||||
// Set HGPLAIN: this means we get consistent output from hg and avoids leakage from a user or system .hgrc.
|
// Set HGPLAIN: this means we get consistent output from hg and avoids leakage from a user or system .hgrc.
|
||||||
env["HGPLAIN"] = "";
|
env["HGPLAIN"] = "";
|
||||||
opts.environment = env;
|
opts.environment = env;
|
||||||
|
|
||||||
return opts;
|
return opts;
|
||||||
}
|
}
|
||||||
|
|
||||||
// runProgram wrapper that uses hgOptions instead of stock RunOptions.
|
// runProgram wrapper that uses hgOptions instead of stock RunOptions.
|
||||||
string runHg(const Strings & args, const std::optional<std::string> & input = {})
|
string runHg(const Strings & args, const std::optional<std::string> & input = {})
|
||||||
{
|
{
|
||||||
RunOptions opts = hgOptions(args);
|
RunOptions opts = hgOptions(args);
|
||||||
opts.input = input;
|
opts.input = input;
|
||||||
|
|
||||||
auto res = runProgram(opts);
|
auto res = runProgram(opts);
|
||||||
|
|
||||||
if (!statusOk(res.first))
|
if (!statusOk(res.first))
|
||||||
throw ExecError(res.first, fmt("hg %1%", statusToString(res.first)));
|
throw ExecError(res.first, fmt("hg %1%", statusToString(res.first)));
|
||||||
|
|
||||||
return res.second;
|
return res.second;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue