1
0
Fork 0
mirror of https://code.forgejo.org/actions/cache.git synced 2025-04-19 19:46:17 +02:00

Prevent commands from executing during tests

This commit is contained in:
Josh Gross 2019-10-31 14:02:15 -04:00
parent d676b6c354
commit 50eb90a503

View file

@ -9,3 +9,14 @@ module.exports = {
},
verbose: true
}
const processStdoutWrite = process.stdout.write.bind(process.stdout)
process.stdout.write = (str, encoding, cb) => {
// We don't want :: commands to be executed by the runner during tests
// Replace any :: with :
if (!str.match(/^::/)) {
return processStdoutWrite(str, encoding, cb);
} else {
return processStdoutWrite(str.replace(/::/g, ":"), encoding, cb);
}
}