| 
									
										
										
										
											2025-10-26 15:23:56 +00:00
										 |  |  | import * as plugins from './plugins.ts'; | 
					
						
							|  |  |  | import * as paths from '../szci.paths.ts'; | 
					
						
							|  |  |  | import { logger } from '../szci.logging.ts'; | 
					
						
							|  |  |  | import { Szci } from '../szci.classes.szci.ts'; | 
					
						
							| 
									
										
										
										
											2022-10-24 21:23:14 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-10-26 15:23:56 +00:00
										 |  |  | export const handleCli = async (szciRefArg: Szci, argvArg: any) => { | 
					
						
							| 
									
										
										
										
											2022-10-24 21:23:14 +02:00
										 |  |  |   logger.log('info', 'checking execution context'); | 
					
						
							| 
									
										
										
										
											2025-10-26 15:23:56 +00:00
										 |  |  |   const presentRunnerTags = Deno.env.get("CI_RUNNER_TAGS").split(',').map((stringArg) => | 
					
						
							| 
									
										
										
										
											2022-10-24 21:23:14 +02:00
										 |  |  |     stringArg.trim() | 
					
						
							|  |  |  |   ); | 
					
						
							|  |  |  |   let allDesiredGitlabRunnerTagsPresent = true; | 
					
						
							| 
									
										
										
										
											2025-10-26 15:23:56 +00:00
										 |  |  |   for (const desiredRunnerTag of szciRefArg.npmciConfig.getConfig().gitlabRunnerTags) { | 
					
						
							| 
									
										
										
										
											2022-10-24 21:23:14 +02:00
										 |  |  |     if (!presentRunnerTags.includes(desiredRunnerTag)) { | 
					
						
							|  |  |  |       allDesiredGitlabRunnerTagsPresent = false; | 
					
						
							|  |  |  |       logger.log( | 
					
						
							|  |  |  |         'error', | 
					
						
							|  |  |  |         `Desired runnerRag ${desiredRunnerTag} is missing in current execution context.` | 
					
						
							|  |  |  |       ); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  |   if (!allDesiredGitlabRunnerTagsPresent) { | 
					
						
							| 
									
										
										
										
											2025-10-26 15:23:56 +00:00
										 |  |  |     Deno.exit(1); | 
					
						
							| 
									
										
										
										
											2022-10-24 21:23:14 +02:00
										 |  |  |   } | 
					
						
							|  |  |  | }; |