import { getScanExePath } from "./env";
const childProcess = require("child_process");
const util = require("util");
const childProcessExec = util.promisify(childProcess.exec);

export function setScanner() {
  const commandStr = `${getScanExePath()} -settings`;
  console.log(commandStr);
  return childProcessExec(commandStr);
}

export function evokeScanner(inputDir) {
  const commandStr = `${getScanExePath()} -scan -d${inputDir}`;
  // console.log(commandStr);
  return childProcessExec(commandStr);
}
