zhangjie 2 年之前
父节点
当前提交
982a119503
共有 2 个文件被更改,包括 6 次插入1 次删除
  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"),
     getOutputDir("origin"),
     getTmpDir(),
     getTmpDir(),
   ];
   ];
-  console.log(paths);
+  // console.log(paths);
   paths.forEach((path) => {
   paths.forEach((path) => {
     if (!fs.existsSync(path)) fs.mkdirSync(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 util = window.nodeRequire("util");
 const childProcessExec = util.promisify(childProcess.exec);
 const childProcessExec = util.promisify(childProcess.exec);
 
 
+const isWindowsPlatform = process.platform === "win32";
+
 export function setScanner() {
 export function setScanner() {
+  if (!isWindowsPlatform) return;
   const commandStr = `${getScanExePath()} -settings`;
   const commandStr = `${getScanExePath()} -settings`;
   console.log(commandStr);
   console.log(commandStr);
   return childProcessExec(commandStr);
   return childProcessExec(commandStr);
 }
 }
 
 
 export function evokeScanner(inputDir) {
 export function evokeScanner(inputDir) {
+  if (!isWindowsPlatform) return;
+
   const commandStr = `${getScanExePath()} -scan -d${inputDir}`;
   const commandStr = `${getScanExePath()} -scan -d${inputDir}`;
   // console.log(commandStr);
   // console.log(commandStr);
   return childProcessExec(commandStr);
   return childProcessExec(commandStr);