MCPcopy Create free account
hub / github.com/expo/eas-cli / shouldExecuteStep

Method shouldExecuteStep

packages/steps/src/BuildStep.ts:307–342  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

305 }
306
307 public shouldExecuteStep(): boolean {
308 const hasAnyPreviousStepFailed = this.ctx.global.hasAnyPreviousStepFailed;
309
310 if (!this.ifCondition) {
311 return !hasAnyPreviousStepFailed;
312 }
313
314 let ifCondition = this.ifCondition;
315
316 if (ifCondition.startsWith('${{') && ifCondition.endsWith('}}')) {
317 ifCondition = ifCondition.slice(3, -2);
318 } else if (ifCondition.startsWith('${') && ifCondition.endsWith('}')) {
319 ifCondition = ifCondition.slice(2, -1);
320 }
321
322 return Boolean(
323 jsepEval(ifCondition, {
324 inputs:
325 this.inputs?.reduce(
326 (acc, input) => {
327 acc[input.id] = input.getValue({
328 interpolationContext: this.getInterpolationContext(),
329 });
330 return acc;
331 },
332 {} as Record<string, unknown>
333 ) ?? {},
334 eas: {
335 runtimePlatform: this.ctx.global.runtimePlatform,
336 ...this.ctx.global.staticContext,
337 env: this.getScriptEnv(),
338 },
339 ...this.getInterpolationContext(),
340 })
341 );
342 }
343
344 public skip(): void {
345 this.status = BuildStepStatus.SKIPPED;

Callers 3

executeAsyncMethod · 0.80
BuildStep-test.tsFile · 0.80

Calls 4

getScriptEnvMethod · 0.95
jsepEvalFunction · 0.90
getValueMethod · 0.80

Tested by

no test coverage detected