mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-05-22 02:12:29 +08:00
GP-669: Fixing GhidraDev exception when ~/ghidra_scripts doesn't exist
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<site>
|
||||
<feature url="features/ghidra.ghidradev_2.1.1.qualifier.jar" id="ghidra.ghidradev" version="2.1.1.qualifier">
|
||||
<feature id="ghidra.ghidradev">
|
||||
<category name="ghidra.ghidradev"/>
|
||||
</feature>
|
||||
<category-def name="ghidra.ghidradev" label="Ghidra"/>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<feature
|
||||
id="ghidra.ghidradev"
|
||||
label="GhidraDev"
|
||||
version="2.1.1.qualifier"
|
||||
version="2.1.2.qualifier"
|
||||
provider-name="Ghidra">
|
||||
|
||||
<description>
|
||||
|
||||
@@ -53,6 +53,8 @@ change with future releases.</p>
|
||||
</ul>
|
||||
|
||||
<h2><a name="ChangeHistory"></a>Change History</h2>
|
||||
<p><u><b>2.1.2</b>:</u> Fixed exception that occurred when creating a new Ghidra scripting project
|
||||
if a <i>~/ghidra_scripts</i> directory does not exist.</p>
|
||||
<p><u><b>2.1.1</b>:</u>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -3,7 +3,7 @@ Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: GhidraDev
|
||||
Bundle-SymbolicName: ghidra.ghidradev;singleton:=true
|
||||
Bundle-Version: 2.1.1.qualifier
|
||||
Bundle-Version: 2.1.2.qualifier
|
||||
Bundle-Activator: ghidradev.Activator
|
||||
Require-Bundle: org.eclipse.ant.core;bundle-version="3.5.200",
|
||||
org.eclipse.buildship.core;bundle-version="3.0.0",
|
||||
|
||||
+7
@@ -25,6 +25,7 @@ import org.eclipse.jdt.core.*;
|
||||
|
||||
import ghidra.GhidraApplicationLayout;
|
||||
import ghidra.framework.GModule;
|
||||
import ghidradev.Activator;
|
||||
|
||||
/**
|
||||
* Utility methods for working with Ghidra scripts in Eclipse.
|
||||
@@ -87,6 +88,12 @@ public class GhidraScriptUtils {
|
||||
|
||||
// Link in the user's personal ghidra_scripts directory
|
||||
if (linkUserScripts) {
|
||||
if (!userScriptsDir.isDirectory()) {
|
||||
if (!userScriptsDir.mkdirs()) {
|
||||
throw new CoreException(new Status(IStatus.ERROR, Activator.PLUGIN_ID,
|
||||
IStatus.ERROR, "Failed to create " + userScriptsDir, null));
|
||||
}
|
||||
}
|
||||
IFolder link = javaProject.getProject().getFolder("Home scripts");
|
||||
link.createLink(new Path(userScriptsDir.getAbsolutePath()), IResource.NONE, monitor);
|
||||
classpathEntries.add(JavaCore.newSourceEntry(link.getFullPath()));
|
||||
|
||||
Reference in New Issue
Block a user