@zondax/zemu
Advanced tools
Comparing version 0.12.5 to 0.12.6
@@ -219,3 +219,3 @@ "use strict"; | ||
return __awaiter(this, void 0, void 0, function () { | ||
var _b; | ||
var _b, e_1; | ||
var _this = this; | ||
@@ -230,5 +230,11 @@ return __generator(this, function (_c) { | ||
Zemu.checkElf((_a = this.startOptions.model) !== null && _a !== void 0 ? _a : constants_1.DEFAULT_MODEL, this.elfPath); | ||
_c.label = 2; | ||
case 2: | ||
_c.trys.push([2, 7, , 8]); | ||
return [4 /*yield*/, Zemu.stopAllEmuContainers()]; | ||
case 3: | ||
_c.sent(); | ||
this.log("[ZEMU] Starting Container"); | ||
return [4 /*yield*/, this.emuContainer.runContainer(options)]; | ||
case 2: | ||
case 4: | ||
_c.sent(); | ||
@@ -241,3 +247,3 @@ this.log("[ZEMU] Started Container"); | ||
})]; | ||
case 3: | ||
case 5: | ||
// eslint-disable-next-line func-names | ||
@@ -249,6 +255,11 @@ _c.sent(); | ||
return [4 /*yield*/, this.snapshot()]; | ||
case 4: | ||
case 6: | ||
// Captures main screen | ||
_b.mainMenuSnapshot = _c.sent(); | ||
return [2 /*return*/]; | ||
return [3 /*break*/, 8]; | ||
case 7: | ||
e_1 = _c.sent(); | ||
this.log("[ZEMU] " + e_1); | ||
return [3 /*break*/, 8]; | ||
case 8: return [2 /*return*/]; | ||
} | ||
@@ -255,0 +266,0 @@ }); |
@@ -5,3 +5,3 @@ { | ||
"license": "Apache-2.0", | ||
"version": "0.12.5", | ||
"version": "0.12.6", | ||
"description": "Zemu Testing Framework", | ||
@@ -8,0 +8,0 @@ "main": "./dist/src/index.js", |
@@ -18,3 +18,3 @@ /** ****************************************************************************** | ||
import fs from 'fs-extra' | ||
import rfb, {RfbClient} from 'rfb2' | ||
import rfb, { RfbClient } from 'rfb2' | ||
import sleep from 'sleep' | ||
@@ -134,3 +134,3 @@ | ||
png.data = rect.data.slice() | ||
const buffer = PNG.PNG.sync.write(png, {colorType: 6}) | ||
const buffer = PNG.PNG.sync.write(png, { colorType: 6 }) | ||
fs.writeFileSync(filename, buffer) | ||
@@ -206,17 +206,23 @@ } | ||
this.log(`[ZEMU] Starting Container`) | ||
await this.emuContainer.runContainer(options) | ||
try { | ||
await Zemu.stopAllEmuContainers() | ||
this.log(`[ZEMU] Started Container`) | ||
this.log(`[ZEMU] Starting Container`) | ||
await this.emuContainer.runContainer(options) | ||
// eslint-disable-next-line func-names | ||
await this.connect().catch(error => { | ||
this.log(`[ZEMU] ${error}`) | ||
this.close() | ||
}) | ||
this.log(`[ZEMU] Started Container`) | ||
this.log(`[ZEMU] Get initial snapshot`) | ||
// eslint-disable-next-line func-names | ||
await this.connect().catch(error => { | ||
this.log(`[ZEMU] ${error}`) | ||
this.close() | ||
}) | ||
// Captures main screen | ||
this.mainMenuSnapshot = await this.snapshot() | ||
this.log(`[ZEMU] Get initial snapshot`) | ||
// Captures main screen | ||
this.mainMenuSnapshot = await this.snapshot() | ||
} catch (e) { | ||
this.log(`[ZEMU] ${e}`) | ||
} | ||
} | ||
@@ -309,3 +315,3 @@ | ||
async snapshot(filename?: string): Promise<any> { | ||
const {vncSession} = this | ||
const { vncSession } = this | ||
@@ -312,0 +318,0 @@ this.log('[ZEMU] Requested snapshot') |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2984189
2416