Skip to content

Commit

Permalink
Set execute permission on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
dhadka committed Jul 20, 2023
1 parent 22d0394 commit 9b97d24
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@ public void install(String algorithm) throws IOException {
extractFile(localFile, installPath);

System.out.println(" > Executing post install steps (if any)");
postInstall(installPath);
postInstall(algorithm, installPath);
} finally {
System.out.println(" > Removing downloaded file");
localFile.delete();
}
}

protected void postInstall(File installPath) throws IOException {
protected void postInstall(String algorithm, File installPath) throws IOException {
// intentionally left blank
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@
*/
package org.moeaframework.algorithm.pisa.installer;

import java.io.File;
import java.io.IOException;
import org.apache.commons.lang3.SystemUtils;
import org.moeaframework.util.io.RedirectStream;

public class LinuxInstaller extends AbstractPISAInstaller {

Expand Down Expand Up @@ -47,6 +49,15 @@ public boolean isOSSupported() {
return SystemUtils.IS_OS_LINUX;
}

@Override
public void postInstall(String algorithm, File installPath) throws IOException {
File executableFile = new File(getInstallPath(algorithm), getCanonicalName(algorithm));

if (executableFile.exists()) {
executableFile.setExecutable(true);
}
}

public static void main(String[] args) throws IOException {
new LinuxInstaller().installAll();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public boolean isOSSupported() {
}

@Override
public void postInstall(File installPath) throws IOException {
public void postInstall(String algorithm, File installPath) throws IOException {
System.out.println("Running make");

try {
Expand Down

0 comments on commit 9b97d24

Please sign in to comment.