Permalink
Browse files

if programFile is specificied, only make that executable

  • Loading branch information...
1 parent 001451a commit fd6df1e3290d84223ba45dd6b3a93ae1933d2c8a @brianm committed Mar 7, 2013
Showing with 5 additions and 5 deletions.
  1. +5 −5 src/main/java/org/skife/waffles/MyMojo.java
@@ -62,7 +62,6 @@ public void execute() throws MojoExecutionException
for (Object item : project.getAttachedArtifacts()) {
AttachedArtifact artifact = (AttachedArtifact) item;
-
if (shouldProcess(artifact)) {
files.add(artifact.getFile());
}
@@ -72,17 +71,18 @@ public void execute() throws MojoExecutionException
throw new MojoExecutionException("Could not find any jars to make executable");
}
- for (File file : files) {
- makeExecutable(file);
- }
-
if (programFile != null && !programFile.matches("\\s+")) {
for (File file : files) {
File dir = file.getParentFile();
File exec = new File(dir, programFile);
FileUtils.copyFile(file, exec);
+ makeExecutable(exec);
Runtime.getRuntime().exec("chmod +x " + exec.getAbsolutePath());
}
+ } else {
+ for (File file : files) {
+ makeExecutable(file);
+ }
}
}

0 comments on commit fd6df1e

Please sign in to comment.