zhangjie hace 2 años
padre
commit
982a119503
Se han modificado 2 ficheros con 6 adiciones y 1 borrados
  1. 1 1
      src/plugins/env.js
  2. 5 0
      src/plugins/scanner.js

+ 1 - 1
src/plugins/env.js

@@ -19,7 +19,7 @@ function initPath() {
     getOutputDir("origin"),
     getTmpDir(),
   ];
-  console.log(paths);
+  // console.log(paths);
   paths.forEach((path) => {
     if (!fs.existsSync(path)) fs.mkdirSync(path);
   });

+ 5 - 0
src/plugins/scanner.js

@@ -3,13 +3,18 @@ const childProcess = window.nodeRequire("child_process");
 const util = window.nodeRequire("util");
 const childProcessExec = util.promisify(childProcess.exec);
 
+const isWindowsPlatform = process.platform === "win32";
+
 export function setScanner() {
+  if (!isWindowsPlatform) return;
   const commandStr = `${getScanExePath()} -settings`;
   console.log(commandStr);
   return childProcessExec(commandStr);
 }
 
 export function evokeScanner(inputDir) {
+  if (!isWindowsPlatform) return;
+
   const commandStr = `${getScanExePath()} -scan -d${inputDir}`;
   // console.log(commandStr);
   return childProcessExec(commandStr);