public void processLocal(String projectLocation, String projectName, String rootFolderPath,
			List<File> filesToImport) throws IOException {

		if (options.readOnly && options.commit) {
			Msg.error(this,
				"Abort due to Headless analyzer error: The requested readOnly option is " +
					"in conflict with the commit option");
			return;
		}

		// If not importing, remove trailing slash so that non-existent folders aren't created
		if (options.runScriptsNoImport) {
			if ((rootFolderPath.endsWith("/")) && (rootFolderPath.length() > 1)) {
				rootFolderPath = rootFolderPath.substring(0, rootFolderPath.length() - 1);
			}
		}
		else {
			// If we are importing, need some files to import or at least a script to run!
			if ((filesToImport == null || filesToImport.size() == 0) &&
				options.preScripts.isEmpty() && options.postScripts.isEmpty()) {
				Msg.warn(this, "REPORT: Nothing to do ... must specify file(s) for import.");
				return;
			}

			// If importing, add trailing slash if it isn't there so that non-existent folders are created
			if (!rootFolderPath.endsWith("/")) {
				rootFolderPath += "/";
			}
		}

		List<String> parsedScriptPaths = parseScriptPaths(options.scriptPaths);
		GhidraScriptUtil.initialize(new BundleHost(), parsedScriptPaths);
		try {
			showConfiguredScriptPaths();
			compileScripts();

			Msg.info(HeadlessAnalyzer.class, "HEADLESS: execution starts");

			File dir = new File(projectLocation);
			ProjectLocator locator = new ProjectLocator(dir.getAbsolutePath(), projectName);

			if (locator.getProjectDir().exists()) {
				project = openProject(locator);
			}
			else {
				if (options.runScriptsNoImport) {
					Msg.error(this, "Could not find project: " + locator +
						" -- should already exist in -process mode.");
					throw new IOException("Could not find project: " + locator);
				}

				if (!options.runScriptsNoImport && options.readOnly) {
					// assume temporary when importing with readOnly option
					options.deleteProject = true;
				}

				Msg.info(this, "Creating " + (options.deleteProject ? "temporary " : "") +
					"project: " + locator);
				project = getProjectManager().createProject(locator, null, false);
			}

			try {

				if (!checkUpdateOptions()) {
					return; // TODO: Should an exception be thrown?
				}

				if (options.runScriptsNoImport) {
					processNoImport(rootFolderPath);
				}
				else {
					processWithImport(rootFolderPath, filesToImport);
				}
			}
			finally {
				project.close();
				if (!options.runScriptsNoImport && options.deleteProject) {
					FileUtilities.deleteDir(locator.getProjectDir());
					locator.getMarkerFile().delete();
				}
			}
		}
		finally {
			GhidraScriptUtil.dispose();
		}
	}
Process the optional import file/directory list and process each imported file:
<ol>
<li>execute ordered list of pre-scripts</li>
<li>perform auto-analysis if not disabled</li>
<li>execute ordered list of post-scripts</li>
</ol>
If no import files or directories have been specified the ordered list
of pre/post scripts will be executed once.

@param projectLocation directory path of project
						  If project exists it will be opened, otherwise it will be created.
@param projectName project name
@param rootFolderPath root folder for imports
@param filesToImport directories and files to be imported (null or empty is acceptable if
       				we are in -process mode)
@throws IOException if there was an IO-related problem.  If caused by a failure to obtain a
write-lock on the project the exception cause will a {@code LockException}.
Ghidra/Features/Base/src/main/java/ghidra/app/util/headless/HeadlessAnalyzer.java