mirror of
https://github.com/actions/cache.git
synced 2025-04-23 22:40:48 +00:00
Prevent commands from executing during tests
This commit is contained in:
parent
d676b6c354
commit
50eb90a503
1 changed files with 11 additions and 0 deletions
|
@ -9,3 +9,14 @@ module.exports = {
|
||||||
},
|
},
|
||||||
verbose: true
|
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);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue