diff --git a/app/plugins/.gitkeep b/app/plugins/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/app/plugins/modules/execute.js b/app/plugins/modules/execute.js deleted file mode 100644 index 439e30c..0000000 --- a/app/plugins/modules/execute.js +++ /dev/null @@ -1,18 +0,0 @@ -const { exec } = require("child_process"); -const os = require('os'); - -module.exports = (cmd) => { - const isWindows = os.type() == "Windows_NT" ? true : false; - - return new Promise((resolve, reject) => { - - exec( - (isWindows ? ('cd '+process.env.scrcpyPath+ '&') : ('')) + cmd, // CD to PreInstalled SCRCPY On Windows - (error, stdout, stderr) => { - if (error || stderr) reject(error || stderr); - resolve(stdout); - } - ); - - }); -} \ No newline at end of file diff --git a/app/plugins/scrcpy-plus-core.js b/app/plugins/scrcpy-plus-core.js index 469865c..243a662 100644 --- a/app/plugins/scrcpy-plus-core.js +++ b/app/plugins/scrcpy-plus-core.js @@ -14,9 +14,18 @@ const execute = (cmd) => { }) } +const utils = { + openInternal(url) { + window.open(url, '_blank', 'autoHideMenuBar=true'); + }, + openExternal(url) { + require("electron").shell.openExternal(url) + } +} + export default defineNuxtPlugin(() => { return { - provide: { execute } + provide: { execute, utils } } }) \ No newline at end of file diff --git a/app/plugins/utils.js b/app/plugins/utils.js deleted file mode 100644 index 045206d..0000000 --- a/app/plugins/utils.js +++ /dev/null @@ -1,12 +0,0 @@ -const module = { - openInternal(url) { - window.open(url, '_blank', 'autoHideMenuBar=true'); - }, - openExternal(url) { - require("electron").shell.openExternal(url) - } -} - -export default ({ app }, inject) => { - inject('utils', module) -} \ No newline at end of file