@aiot-toolkit/emulator 2.0.5-beta.14 → 2.0.5-beta.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -72,8 +72,8 @@ function resolvePath(filePath) {
|
|
|
72
72
|
return _path.default.resolve(filePath);
|
|
73
73
|
}
|
|
74
74
|
function getRunningAvdConfigFiles() {
|
|
75
|
-
const dir = getEmulatorDefaultConfigDir();
|
|
76
75
|
try {
|
|
76
|
+
const dir = getEmulatorDefaultConfigDir();
|
|
77
77
|
const files = _fs.default.readdirSync(dir);
|
|
78
78
|
return files.filter(t => fileNamePattern.test(t)).map(t => _path.default.join(dir, t));
|
|
79
79
|
} catch (error) {
|
package/lib/instance/common.d.ts
CHANGED
|
@@ -7,9 +7,11 @@ declare abstract class CommonEmulatorInstance {
|
|
|
7
7
|
appDir: string;
|
|
8
8
|
static emulatorStartedFlag: RegExp;
|
|
9
9
|
static appInstalledFlag: RegExp;
|
|
10
|
+
static appInstallFailedFlag: RegExp;
|
|
10
11
|
static appUninstalledFlag: RegExp;
|
|
11
12
|
static appStartedFlag: RegExp;
|
|
12
13
|
static isAppInstalled(log: string): boolean;
|
|
14
|
+
static isAppInstallFailed(log: string): boolean;
|
|
13
15
|
static isAppUninstalled(log: string, packageName: string): boolean;
|
|
14
16
|
static isEmulatorStarted(log: string): boolean;
|
|
15
17
|
sn: string;
|
package/lib/instance/common.js
CHANGED
|
@@ -18,11 +18,15 @@ class CommonEmulatorInstance {
|
|
|
18
18
|
appDir = '/data/quickapp/app';
|
|
19
19
|
static emulatorStartedFlag = /quickapp_rpk_installer_init|rpk installer init done|booting completed|Boot completed/;
|
|
20
20
|
static appInstalledFlag = /InstallState_Finished|install finished/;
|
|
21
|
+
static appInstallFailedFlag = /uv_mq_read_cb: install prepare failed/;
|
|
21
22
|
static appUninstalledFlag = /uninstalled app/;
|
|
22
23
|
static appStartedFlag = /Start App loop/;
|
|
23
24
|
static isAppInstalled(log) {
|
|
24
25
|
return this.appInstalledFlag.test(log);
|
|
25
26
|
}
|
|
27
|
+
static isAppInstallFailed(log) {
|
|
28
|
+
return this.appInstallFailedFlag.test(log);
|
|
29
|
+
}
|
|
26
30
|
static isAppUninstalled(log, packageName) {
|
|
27
31
|
return new RegExp(this.appUninstalledFlag + ':\\s+' + packageName).test(log);
|
|
28
32
|
}
|
package/lib/instance/miwear.js
CHANGED
|
@@ -32,8 +32,15 @@ class MiwearInstance extends _common.default {
|
|
|
32
32
|
if (MiwearInstance.isAppInstalled(msg)) {
|
|
33
33
|
clearTimeout(timer);
|
|
34
34
|
this.logger(`Install to ${this.vvdName} ${targeRpk} successfully`);
|
|
35
|
+
this.stdoutReadline.off('line', func);
|
|
35
36
|
resolve();
|
|
36
37
|
}
|
|
38
|
+
if (MiwearInstance.isAppInstallFailed(msg)) {
|
|
39
|
+
clearTimeout(timer);
|
|
40
|
+
this.stdoutReadline.off('line', func);
|
|
41
|
+
this.logger(`Failed Install to ${this.vvdName} ${targeRpk}`);
|
|
42
|
+
reject(msg);
|
|
43
|
+
}
|
|
37
44
|
};
|
|
38
45
|
let timer = setTimeout(() => {
|
|
39
46
|
this.stdoutReadline.off('line', func);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aiot-toolkit/emulator",
|
|
3
|
-
"version": "2.0.5-beta.
|
|
3
|
+
"version": "2.0.5-beta.16",
|
|
4
4
|
"description": "vela emulator tool.",
|
|
5
5
|
"homepage": "",
|
|
6
6
|
"license": "ISC",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"emulator"
|
|
37
37
|
],
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@aiot-toolkit/shared-utils": "2.0.5-beta.
|
|
39
|
+
"@aiot-toolkit/shared-utils": "2.0.5-beta.16",
|
|
40
40
|
"@grpc/grpc-js": "^1.13.3",
|
|
41
41
|
"@grpc/proto-loader": "^0.7.13",
|
|
42
42
|
"@miwt/adb": "^0.9.0",
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"@types/adm-zip": "^0.5.5",
|
|
54
54
|
"@types/ini": "^4.1.1"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "66255b9d69f9b15db10283d662f94f3d1f2486c3"
|
|
57
57
|
}
|