mirror of
				https://github.com/actions/cache.git
				synced 2025-10-31 03:38:36 +08:00 
			
		
		
		
	Prevent commands from executing during tests
This commit is contained in:
		
							parent
							
								
									d676b6c354
								
							
						
					
					
						commit
						50eb90a503
					
				|  | @ -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); | ||||
|   } | ||||
| } | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Josh Gross
						Josh Gross