|
@@ -4,6 +4,7 @@ import cn.hutool.core.io.FileUtil;
|
|
|
import cn.hutool.core.io.file.FileReader;
|
|
import cn.hutool.core.io.file.FileReader;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
+import org.apache.commons.lang.SystemUtils;
|
|
|
|
|
|
|
|
import java.io.*;
|
|
import java.io.*;
|
|
|
import java.util.regex.Matcher;
|
|
import java.util.regex.Matcher;
|
|
@@ -25,6 +26,13 @@ public class ShellUtil {
|
|
|
long startTime = System.currentTimeMillis();
|
|
long startTime = System.currentTimeMillis();
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
|
|
|
+ if(!SystemUtils.IS_OS_WINDOWS){
|
|
|
|
|
+ cmd = cmd.replaceAll("7za.exe","7zz");
|
|
|
|
|
+ cmd = cmd.replaceAll("ConvertApp.exe","run_convert.sh");
|
|
|
|
|
+ cmd = cmd.replaceAll(".exe","");
|
|
|
|
|
+ cmd = cmd.replaceAll(".bat",".sh");
|
|
|
|
|
+ cmd = "bash "+ cmd;
|
|
|
|
|
+ }
|
|
|
// 执行命令, 返回一个子进程对象(命令在子进程中执行)
|
|
// 执行命令, 返回一个子进程对象(命令在子进程中执行)
|
|
|
log.info("执行cmd:{}",cmd);
|
|
log.info("执行cmd:{}",cmd);
|
|
|
process = Runtime.getRuntime().exec(cmd);
|
|
process = Runtime.getRuntime().exec(cmd);
|