mirror of
https://github.com/reactivecircus/android-emulator-runner.git
synced 2026-09-03 10:59:32 +00:00
Update dependencies (#282)
* Update packages * Fix TS errors * rebuild * Update eslint See https://github.com/prettier/eslint-config-prettier/blob/main/CHANGELOG.md#version-800-2021-02-21 * Fix linting errors * rebuild
This commit is contained in:
committed by
GitHub
parent
a47c099672
commit
a4845e8d39
@@ -72,8 +72,8 @@ export async function launchEmulator(
|
||||
if (data.toString().includes('invalid command-line parameter')) {
|
||||
throw new Error(data.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
// wait for emulator to complete booting
|
||||
@@ -105,7 +105,7 @@ export async function killEmulator(): Promise<void> {
|
||||
console.log(`::group::Terminate Emulator`);
|
||||
await exec.exec(`adb -s emulator-5554 emu kill`);
|
||||
} catch (error) {
|
||||
console.log(error.message);
|
||||
console.log(error instanceof Error ? error.message : error);
|
||||
} finally {
|
||||
console.log(`::endgroup::`);
|
||||
}
|
||||
@@ -126,8 +126,8 @@ async function waitForDevice(): Promise<void> {
|
||||
listeners: {
|
||||
stdout: (data: Buffer) => {
|
||||
result += data.toString();
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
if (result.trim() === '1') {
|
||||
console.log('Emulator booted.');
|
||||
@@ -135,7 +135,7 @@ async function waitForDevice(): Promise<void> {
|
||||
break;
|
||||
}
|
||||
} catch (error) {
|
||||
console.warn(error.message);
|
||||
console.warn(error instanceof Error ? error.message : error);
|
||||
}
|
||||
|
||||
if (attempts < maxAttempts) {
|
||||
@@ -148,5 +148,5 @@ async function waitForDevice(): Promise<void> {
|
||||
}
|
||||
|
||||
function delay(ms: number) {
|
||||
return new Promise(resolve => setTimeout(resolve, ms));
|
||||
return new Promise((resolve) => setTimeout(resolve, ms));
|
||||
}
|
||||
|
||||
+5
-5
@@ -11,7 +11,7 @@ import {
|
||||
checkForceAvdCreation,
|
||||
checkChannel,
|
||||
checkEnableHardwareKeyboard,
|
||||
checkDiskSize
|
||||
checkDiskSize,
|
||||
} from './input-validator';
|
||||
import { launchEmulator, killEmulator } from './emulator-manager';
|
||||
import * as exec from '@actions/exec';
|
||||
@@ -184,11 +184,11 @@ async function run() {
|
||||
// use array form to avoid various quote escaping problems
|
||||
// caused by exec(`sh -c "${preEmulatorLaunchScript}"`)
|
||||
await exec.exec('sh', ['-c', preEmulatorLaunchScript], {
|
||||
cwd: workingDirectory
|
||||
cwd: workingDirectory,
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
core.setFailed(error.message);
|
||||
core.setFailed(error instanceof Error ? error.message : (error as string));
|
||||
}
|
||||
console.log(`::endgroup::`);
|
||||
}
|
||||
@@ -225,7 +225,7 @@ async function run() {
|
||||
await exec.exec('sh', ['-c', script]);
|
||||
}
|
||||
} catch (error) {
|
||||
core.setFailed(error.message);
|
||||
core.setFailed(error instanceof Error ? error.message : (error as string));
|
||||
}
|
||||
|
||||
// finally kill the emulator
|
||||
@@ -233,7 +233,7 @@ async function run() {
|
||||
} catch (error) {
|
||||
// kill the emulator so the action can exit
|
||||
await killEmulator();
|
||||
core.setFailed(error.message);
|
||||
core.setFailed(error instanceof Error ? error.message : (error as string));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user