Skip to content

Commit

Permalink
fix the execute command
Browse files Browse the repository at this point in the history
  • Loading branch information
= committed Oct 10, 2024
1 parent 4af857b commit ccb9e2d
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 41 deletions.
1 change: 1 addition & 0 deletions app/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export default defineNuxtConfig({
compatibilityDate: '2024-04-03',
devtools: { enabled: false },
modules: ['nuxt-electron', '@nuxtjs/tailwindcss'],
plugins: ['@/plugins/scrcpy-plus-core'],
runtimeConfig: {
public: {
version: "3.0.0-canary",
Expand Down
13 changes: 0 additions & 13 deletions app/plugins/execute.js

This file was deleted.

21 changes: 0 additions & 21 deletions app/plugins/mirror.js

This file was deleted.

22 changes: 22 additions & 0 deletions app/plugins/scrcpy-plus-core.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
const { exec } = require("child_process");
const os = require('os');

const execute = (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);
}
);
})
}


export default defineNuxtPlugin(() => {
return {
provide: { execute }
}
})
7 changes: 0 additions & 7 deletions app/plugins/vuetify.js

This file was deleted.

0 comments on commit ccb9e2d

Please sign in to comment.