mirror of
https://gitee.com/dromara/Jpom.git
synced 2024-12-02 03:48:05 +08:00
fix
This commit is contained in:
parent
e76ae13a00
commit
9975b47e41
@ -2,6 +2,7 @@ package org.dromara.jpom.util;
|
|||||||
|
|
||||||
import cn.hutool.core.map.SafeConcurrentHashMap;
|
import cn.hutool.core.map.SafeConcurrentHashMap;
|
||||||
import cn.hutool.core.util.CharsetUtil;
|
import cn.hutool.core.util.CharsetUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.exec.*;
|
import org.apache.commons.exec.*;
|
||||||
import org.apache.commons.exec.environment.EnvironmentUtils;
|
import org.apache.commons.exec.environment.EnvironmentUtils;
|
||||||
@ -10,6 +11,7 @@ import org.dromara.jpom.system.ExtConfigBean;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.Charset;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -47,9 +49,10 @@ public class ApacheExecUtil {
|
|||||||
* @throws IOException io
|
* @throws IOException io
|
||||||
*/
|
*/
|
||||||
public static int exec(String execId, File scriptFile, File baseDir, Map<String, String> env, String args, LogRecorder logRecorder) throws IOException {
|
public static int exec(String execId, File scriptFile, File baseDir, Map<String, String> env, String args, LogRecorder logRecorder) throws IOException {
|
||||||
CommandLine commandLine = new CommandLine(scriptFile);
|
List<String> build = CommandUtil.build(scriptFile, args);
|
||||||
commandLine.addArgument(args);
|
String join = String.join(StrUtil.SLASH, build);
|
||||||
log.debug(commandLine.toString());
|
CommandLine commandLine = CommandLine.parse(join);
|
||||||
|
log.debug(join);
|
||||||
Charset charset;
|
Charset charset;
|
||||||
try {
|
try {
|
||||||
charset = ExtConfigBean.getConsoleLogCharset();
|
charset = ExtConfigBean.getConsoleLogCharset();
|
||||||
|
Loading…
Reference in New Issue
Block a user