mirror of
https://github.com/appium/appium.git
synced 2026-02-20 18:30:11 -06:00
17 lines
650 B
JavaScript
Executable File
17 lines
650 B
JavaScript
Executable File
import {UniversalXMLPlugin} from './plugin';
|
|
import {transformSourceXml} from './source';
|
|
import fs from 'node:fs/promises';
|
|
export default UniversalXMLPlugin;
|
|
export {UniversalXMLPlugin};
|
|
|
|
export async function main() {
|
|
const [, , xmlDataPath, platform, optsJson] = process.argv;
|
|
const xmlData = await fs.readFile(xmlDataPath, 'utf8');
|
|
const opts = optsJson ? JSON.parse(optsJson) : {};
|
|
const {xml, unknowns} = await transformSourceXml(xmlData, platform, opts);
|
|
console.log(xml); // eslint-disable-line no-console
|
|
if (unknowns.nodes.length || unknowns.attrs.length) {
|
|
console.error(unknowns); // eslint-disable-line no-console
|
|
}
|
|
}
|