Sync public tree to 9233b1e
This commit is contained in:
parent
58e7fb9ebb
commit
9f76e3e70a
5 changed files with 77 additions and 21 deletions
|
|
@ -64,13 +64,15 @@ function ensureDir(dir) {
|
|||
function run(command, args, options = {}) {
|
||||
const commandLine = [command, ...args].join(" ");
|
||||
commands.push(commandLine);
|
||||
return cp.execFileSync(command, args, {
|
||||
const execOptions = {
|
||||
cwd: repo,
|
||||
encoding: "utf8",
|
||||
stdio: ["ignore", "pipe", "pipe"],
|
||||
timeout: 15 * 60 * 1000,
|
||||
...options,
|
||||
});
|
||||
};
|
||||
execOptions.env = commandEnv(command, options.env);
|
||||
return cp.execFileSync(command, args, execOptions);
|
||||
}
|
||||
|
||||
function runJson(command, args, options = {}) {
|
||||
|
|
@ -89,19 +91,39 @@ function runJson(command, args, options = {}) {
|
|||
|
||||
function commandOutput(command, args, options = {}) {
|
||||
try {
|
||||
return cp
|
||||
.execFileSync(command, args, {
|
||||
cwd: repo,
|
||||
encoding: "utf8",
|
||||
stdio: ["ignore", "pipe", "ignore"],
|
||||
...options,
|
||||
})
|
||||
.trim();
|
||||
const execOptions = {
|
||||
cwd: repo,
|
||||
encoding: "utf8",
|
||||
stdio: ["ignore", "pipe", "ignore"],
|
||||
...options,
|
||||
};
|
||||
execOptions.env = commandEnv(command, options.env);
|
||||
return cp.execFileSync(command, args, execOptions).trim();
|
||||
} catch (_) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
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 expectedSourceCommit() {
|
||||
return (
|
||||
process.env.DISASMER_ACCEPTANCE_COMMIT ||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue