Skip to content

Commit

Permalink
Fix new typescript findings
Browse files Browse the repository at this point in the history
  • Loading branch information
dotdoom committed Oct 16, 2022
1 parent b15d416 commit 4770d61
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/main.ts
@@ -1,7 +1,7 @@
import * as core from '@actions/core'
import {boolean} from 'boolean'
import { boolean } from 'boolean'
import * as semver from 'semver'
import {deviceToString, getDevices, simctl} from './xcrun'
import { deviceToString, getDevices, simctl } from './xcrun'

async function run(): Promise<void> {
try {
Expand Down Expand Up @@ -86,7 +86,11 @@ async function run(): Promise<void> {

core.setOutput('udid', device.udid)
} catch (error) {
core.setFailed(error.message)
let errorMessage = 'Failed to run simulator-action (reason unknown)';
if (error instanceof Error) {
errorMessage = error.message;
}
core.setFailed(errorMessage);
}
}

Expand All @@ -98,7 +102,11 @@ async function cleanup(): Promise<void> {
await simctl('shutdown', udid)
}
} catch (error) {
core.setFailed(error.message)
let errorMessage = 'Failed to cleanup simulator-action (reason unknown)';
if (error instanceof Error) {
errorMessage = error.message;
}
core.setFailed(errorMessage);
}
}

Expand Down

0 comments on commit 4770d61

Please sign in to comment.