| 
									
										
										
										
											2017-07-27 19:24:56 +08:00
										 |  |  | "use strict"; | 
					
						
							| 
									
										
										
										
											2012-04-05 20:59:01 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-07-27 19:24:56 +08:00
										 |  |  | const cp = require("child_process"); | 
					
						
							|  |  |  | const examples = require("./examples"); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-03-13 00:51:26 +08:00
										 |  |  | const commands = examples.map(function(dirname) { | 
					
						
							| 
									
										
										
										
											2013-12-20 06:23:12 +08:00
										 |  |  | 	return "cd " + dirname + " && node build.js"; | 
					
						
							|  |  |  | }); | 
					
						
							| 
									
										
										
										
											2012-04-05 20:59:01 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-20 00:06:59 +08:00
										 |  |  | let failed = 0; | 
					
						
							| 
									
										
										
										
											2017-07-27 19:24:56 +08:00
										 |  |  | let i = 0; | 
					
						
							| 
									
										
										
										
											2020-03-13 00:51:26 +08:00
										 |  |  | for(const cmd of commands) { | 
					
						
							|  |  |  | 	console.log(`[${++i}/${commands.length}] ${cmd}`); | 
					
						
							| 
									
										
										
										
											2018-01-20 00:06:59 +08:00
										 |  |  | 	try { | 
					
						
							|  |  |  | 		cp.execSync(cmd, { encoding: "utf-8" }); | 
					
						
							|  |  |  | 	} catch(e) { | 
					
						
							|  |  |  | 		failed++; | 
					
						
							|  |  |  | 		console.log(e); | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2012-07-19 17:59:17 +08:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2017-07-27 19:24:56 +08:00
										 |  |  | console.log("done"); | 
					
						
							| 
									
										
										
										
											2018-01-20 00:06:59 +08:00
										 |  |  | if(failed > 0) | 
					
						
							|  |  |  | 	console.log(`${failed} failed`); |