Skip to content

Commit

Permalink
Fix #748
Browse files Browse the repository at this point in the history
  • Loading branch information
i-make-robots committed Jun 2, 2024
1 parent 0251e91 commit 5e90739
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.marginallyclever</groupId>
<artifactId>Makelangelo</artifactId>
<version>7.55.3</version>
<version>7.55.4</version>
<name>Makelangelo</name>
<description>Makelangelo Software is a Java program that prepares art for CNC plotters. It is especially designed for the Makelangelo Robot.
It pairs really well with Marlin-polargraph, the code in the brain of the robot that receives instructions and moves the motors.</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class AVRDudeDownloader {
private static final String ARDUINO_PACKAGE_INDEX = "https://downloads.arduino.cc/packages/package_index.json";

public static void main(String[] args) throws IOException {
downloadAVRDude(MACOS);
downloadAVRDude(getArch());
}


Expand Down Expand Up @@ -143,21 +143,21 @@ private static void makeExecutable(String targetPath) throws IOException {
String app = "avrdude";
if(OSHelper.isWindows()) app+=".exe";

Path avrdudePath = Paths.get(targetPath, app);
logger.info("makeExecutable 1: " + targetPath);
logger.info("makeExecutable 2: " + app);
logger.info("makeExecutable 3: " + avrdudePath.toAbsolutePath());

File avrdudeFile = avrdudePath.toFile();
if (!avrdudeFile.exists()) {
throw new IOException("File " + avrdudeFile.getAbsolutePath() + " does not exist");
File avrDudeFile = tryPath(Paths.get(targetPath, app));
if(!avrDudeFile.exists()) avrDudeFile = tryPath(Paths.get(targetPath, "bin", app));
if(!avrDudeFile.exists()) {
throw new IOException("File " + app + " does not exist");
}

if(!avrdudeFile.setExecutable(true)) {
throw new IOException("Could not set executable permissions for " + avrdudeFile.getAbsolutePath());
if(!avrDudeFile.setExecutable(true)) {
throw new IOException("Could not set executable permissions for " + avrDudeFile.getAbsolutePath());
}
}

private static File tryPath(Path avrdudePath) {
logger.info("trying path: " + avrdudePath.toAbsolutePath());
return avrdudePath.toFile();
}

private static File downloadFileToTemp(String urlStr) throws IOException {
logger.info("download from: " + urlStr);
URL url = new URL(urlStr);
Expand Down

0 comments on commit 5e90739

Please sign in to comment.