Skip to content

Commit

Permalink
fix(installation): Grant file permission before executable verification
Browse files Browse the repository at this point in the history
  • Loading branch information
alirana01 committed Sep 14, 2023
1 parent b9c4271 commit 25868db
Showing 1 changed file with 17 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
package com.espressif.idf.core;

import java.io.File;
import java.io.IOException;

import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;

import com.espressif.idf.core.logging.Logger;
import com.espressif.idf.core.util.StringUtil;

public class SystemExecutableFinder implements ExecutableFinder
Expand Down Expand Up @@ -79,9 +81,21 @@ private IPath findExecutable(IPath path)
}

}
else if (isExecutable(path))
else
{
return path;
try
{
Runtime.getRuntime().exec("/bin/chmod 755 ".concat(path.toOSString())); //$NON-NLS-1$
}
catch (IOException e)
{
Logger.log(e);
}

if (isExecutable(path))
{
return path;
}
}
return null;
}
Expand All @@ -100,7 +114,7 @@ private boolean isExecutable(IPath path)
{
return false;
}

return file.canExecute();
}
}

0 comments on commit 25868db

Please sign in to comment.