|
|
@@ -479,34 +479,34 @@ function rDBPlugin(): HvigorPlugin {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-function forwardingPort(){
|
|
|
- return {
|
|
|
- pluginId: 'customPlugin',
|
|
|
- apply(node: HvigorNode) {
|
|
|
- try {
|
|
|
- var connectKeys = execSync('hdc list targets', { encoding: 'utf-8' }).split('\n');
|
|
|
-
|
|
|
- var targetKey = connectKeys[0].trim();
|
|
|
-
|
|
|
- var operation = `hdc -t ${targetKey} fport rm tcp:8080 tcp:8080`
|
|
|
- var result = execSync(operation, { encoding: 'utf-8' })
|
|
|
- console.log(`执行命令 ${operation}, 删除端口结果:${result.trim()}`);
|
|
|
-
|
|
|
- operation = `hdc -t ${targetKey} fport tcp:8080 tcp:8080`
|
|
|
- result = execSync(operation, { encoding: 'utf-8' })
|
|
|
- console.log(`执行命令 ${operation}, 转发端口结果:${result.trim()}`);
|
|
|
- } catch (error) {
|
|
|
- console.error(`执行失败: ${error.message}`);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
+// function forwardingPort(){
|
|
|
+// return {
|
|
|
+// pluginId: 'customPlugin',
|
|
|
+// apply(node: HvigorNode) {
|
|
|
+// try {
|
|
|
+// var connectKeys = execSync('hdc list targets', { encoding: 'utf-8' }).split('\n');
|
|
|
+//
|
|
|
+// var targetKey = connectKeys[0].trim();
|
|
|
+//
|
|
|
+// var operation = `hdc -t ${targetKey} fport rm tcp:8080 tcp:8080`
|
|
|
+// var result = execSync(operation, { encoding: 'utf-8' })
|
|
|
+// console.log(`执行命令 ${operation}, 删除端口结果:${result.trim()}`);
|
|
|
+//
|
|
|
+// operation = `hdc -t ${targetKey} fport tcp:8080 tcp:8080`
|
|
|
+// result = execSync(operation, { encoding: 'utf-8' })
|
|
|
+// console.log(`执行命令 ${operation}, 转发端口结果:${result.trim()}`);
|
|
|
+// } catch (error) {
|
|
|
+// console.error(`执行失败: ${error.message}`);
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
|
|
|
export default {
|
|
|
system: appTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
|
|
|
plugins: [
|
|
|
customPlugin(), // 应用自定义Plugin
|
|
|
rDBPlugin(),
|
|
|
- forwardingPort()
|
|
|
+ // forwardingPort()
|
|
|
] /* Custom plugin to extend the functionality of Hvigor. */
|
|
|
}
|