fix(appium): when updating extensions, package fields should also be updated in extensions.yaml
MODIFY
packages/appium/lib/cli/extension-command.js
packages/appium/lib/cli/extension-command.js
@@ -483,9 +483,9 @@ export default class ExtensionCommand {
*/
async updateExtension (ext, version) {
const {pkgName} = this.config.installedExtensions[ext];
- await this.installViaNpm({ext, pkgName, pkgVer: version});
- this.config.installedExtensions[ext].version = version;
- await this.config.write();
+ const extData = await this.installViaNpm({ext, pkgName, pkgVer: version});
+ delete extData[`${this.type}Name`];
+ await this.config.updateExtension(ext, extData);
}
/**

MODIFY
packages/appium/lib/extension-config.js
packages/appium/lib/extension-config.js
@@ -160,6 +160,14 @@ export default class ExtensionConfig {
await this.write();
}
+ async updateExtension (extName, extData) {
+ this.installedExtensions[extName] = {
+ ...this.installedExtensions[extName],
+ ...extData,
+ };
+ await this.write();
+ }
+
async removeExtension (extName) {
delete this.installedExtensions[extName];
await this.write();

fix(appium): when updating extensions, package fields should also be updated in extensions.yaml