GP-1034: New script action now creates ~/ghidra_scripts if it didn't exist

This commit is contained in:
Ryan Kurtz 2021-06-11 09:22:23 -04:00
parent ead982a5e5
commit a8b9db5f32

View file

@ -549,8 +549,12 @@ public class GhidraScriptComponentProvider extends ComponentProviderAdapter {
return;
}
// Create user script directory if it doesn't exist
File userScriptsDir = new File(GhidraScriptUtil.USER_SCRIPTS_DIR);
FileUtilities.checkedMkdirs(userScriptsDir);
ResourceFile newFile = GhidraScriptUtil.createNewScript(provider,
new ResourceFile(GhidraScriptUtil.USER_SCRIPTS_DIR), getScriptDirectories());
new ResourceFile(userScriptsDir), getScriptDirectories());
SaveDialog dialog = new SaveNewScriptDialog(getComponent(), "New Script", this, newFile,
actionManager.getNewHelpLocation());
if (dialog.isCancelled()) {