forked from eirslett/frontend-maven-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
NodeExecutor.java
26 lines (20 loc) · 933 Bytes
/
NodeExecutor.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package com.github.eirslett.maven.plugins.frontend.lib;
import org.slf4j.Logger;
import java.util.ArrayList;
import java.util.List;
final class NodeExecutor {
private final ProcessExecutor executor;
public NodeExecutor(NodeExecutorConfig config, List<String> arguments){
final String node = config.getNodePath().getAbsolutePath();
List<String> localPaths = new ArrayList<String>();
localPaths.add(config.getNodePath().getParent());
this.executor = new ProcessExecutor(config.getWorkingDirectory(), localPaths, node, arguments,
config.getPlatform());
}
public String executeAndGetResult(final Logger logger) throws ProcessExecutionException {
return executor.executeAndGetResult(logger);
}
public int executeAndRedirectOutput(final Logger logger) throws ProcessExecutionException {
return executor.executeAndRedirectOutput(logger);
}
}