Sync public tree to 9233b1e
This commit is contained in:
parent
58e7fb9ebb
commit
9f76e3e70a
5 changed files with 77 additions and 21 deletions
|
|
@ -32,13 +32,15 @@ const publicBinaries = [
|
|||
|
||||
function commandOutput(command, args, options = {}) {
|
||||
try {
|
||||
const execOptions = {
|
||||
cwd: repo,
|
||||
encoding: "utf8",
|
||||
stdio: ["ignore", "pipe", "ignore"],
|
||||
...options,
|
||||
};
|
||||
execOptions.env = commandEnv(command, options.env);
|
||||
return cp
|
||||
.execFileSync(command, args, {
|
||||
cwd: repo,
|
||||
encoding: "utf8",
|
||||
stdio: ["ignore", "pipe", "ignore"],
|
||||
...options,
|
||||
})
|
||||
.execFileSync(command, args, execOptions)
|
||||
.trim();
|
||||
} catch (_) {
|
||||
return null;
|
||||
|
|
@ -46,11 +48,33 @@ function commandOutput(command, args, options = {}) {
|
|||
}
|
||||
|
||||
function run(command, args, options = {}) {
|
||||
cp.execFileSync(command, args, {
|
||||
const execOptions = {
|
||||
cwd: repo,
|
||||
stdio: "inherit",
|
||||
...options,
|
||||
});
|
||||
};
|
||||
execOptions.env = commandEnv(command, options.env);
|
||||
cp.execFileSync(command, args, execOptions);
|
||||
}
|
||||
|
||||
function nonInteractiveGitEnv(extra = {}) {
|
||||
return {
|
||||
...process.env,
|
||||
GIT_TERMINAL_PROMPT: "0",
|
||||
GIT_ASKPASS: process.env.GIT_ASKPASS || "/bin/false",
|
||||
SSH_ASKPASS: process.env.SSH_ASKPASS || "/bin/false",
|
||||
GIT_SSH_COMMAND:
|
||||
process.env.GIT_SSH_COMMAND ||
|
||||
"ssh -o BatchMode=yes -o NumberOfPasswordPrompts=0",
|
||||
...extra,
|
||||
};
|
||||
}
|
||||
|
||||
function commandEnv(command, env) {
|
||||
if (command !== "git") {
|
||||
return env;
|
||||
}
|
||||
return nonInteractiveGitEnv(env);
|
||||
}
|
||||
|
||||
function ensureDir(dir) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue