Skip to content

Commit be59501

Browse files
committed
U refactoring
1 parent 061e4bd commit be59501

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/main/java/io/github/fvarrui/javapackager/packagers/GenerateMsi.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
package io.github.fvarrui.javapackager.packagers;
22

3+
import static io.github.fvarrui.javapackager.utils.CommandUtils.execute;
4+
35
import java.io.File;
46

5-
import io.github.fvarrui.javapackager.utils.CommandUtils;
67
import io.github.fvarrui.javapackager.utils.Logger;
78
import io.github.fvarrui.javapackager.utils.VelocityUtils;
89
import io.github.fvarrui.javapackager.utils.XMLUtils;
@@ -45,13 +46,13 @@ public File apply(Packager packager) throws Exception {
4546
// candle wxs file
4647
Logger.info("Compiling file " + wxsFile);
4748
File wixobjFile = new File(assetsFolder, name + ".wixobj");
48-
CommandUtils.execute("candle", "-out", wixobjFile, wxsFile);
49+
execute("candle", "-out", wixobjFile, wxsFile);
4950
Logger.info("WIXOBJ file generated in " + wixobjFile + "!");
5051

5152
// lighting wxs file
5253
Logger.info("Linking file " + wixobjFile);
5354
File msiFile = new File(outputDirectory, name + "_" + version + ".msi");
54-
CommandUtils.execute("light", "-spdb", "-out", msiFile, wixobjFile);
55+
execute("light", "-spdb", "-out", msiFile, wixobjFile);
5556

5657
// setup file
5758
if (!msiFile.exists()) {

src/main/java/io/github/fvarrui/javapackager/utils/CommandUtils.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ public static ExecutionResult executeWithResult(File workingDirectory, String ex
3434
command.createArguments(arguments);
3535
command.toString();
3636

37-
result.setCommandLine(command.getCommandLineAsString());
37+
String commandLine = command.getCommandLineAsString();
3838

39-
Logger.info("Executing command: " + result.getCommandLine());
39+
Logger.info("Executing command: " + commandLine);
4040

4141
Process process = command.execute();
4242

@@ -57,6 +57,7 @@ public static ExecutionResult executeWithResult(File workingDirectory, String ex
5757
output.close();
5858
error.close();
5959

60+
result.setCommandLine(commandLine);
6061
result.setOutput(outputBuffer.toString());
6162
result.setError(errorBuffer.toString());
6263
result.setExitCode(process.exitValue());

0 commit comments

Comments
 (0)