From 49819b0e12fa2720c91d3dd995efc6186435c4ae Mon Sep 17 00:00:00 2001 From: Tim Lancina Date: Wed, 29 May 2019 19:18:01 -0700 Subject: [PATCH] fix(ios): print more helpful error if app path doesn't exist --- src/ios/run.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ios/run.ts b/src/ios/run.ts index 72ee1c3..464ed89 100644 --- a/src/ios/run.ts +++ b/src/ios/run.ts @@ -1,6 +1,6 @@ import { remove } from '@ionic/utils-fs'; import * as Debug from 'debug'; -import { mkdtempSync } from 'fs'; +import { existsSync, mkdtempSync } from 'fs'; import * as path from 'path'; import { CLIException, ERR_BAD_INPUT, ERR_TARGET_NOT_FOUND, RunException } from '../errors'; @@ -21,6 +21,11 @@ export async function run(args: string[]) { const preferSimulator = args.includes('--virtual'); const waitForApp = args.includes('--connect'); const isIPA = appPath.endsWith('.ipa'); + + if (!existsSync(appPath)) { + throw new RunException(`Path '${appPath}' not found`); + } + try { if (isIPA) { const { tmpdir } = await import('os');