protected void cleanupOldTestFiles() {
		// remove the compiled bundles directory so that any scripts we use will be recompiled
		delete(GhidraSourceBundle.getCompiledBundlesDir());

		String myTestName = super.testName.getMethodName();

		// destroy any NewScriptxxx files...and Temp ones too
		List<ResourceFile> paths = provider.getBundleHost()
				.getBundleFiles()
				.stream()
				.filter(ResourceFile::isDirectory)
				.collect(Collectors.toList());

		for (ResourceFile path : paths) {
			File file = path.getFile(false);
			File[] listFiles = file.listFiles();
			if (listFiles == null) {
				continue;
			}

			for (File dirFile : listFiles) {
				String name = dirFile.getName();
				if (name.startsWith("NewScript") || name.startsWith("Temp") ||
					name.startsWith(myTestName)) {
					deleteFile(new ResourceFile(dirFile));
				}
			}
		}
	}
Run the last script by pressing the last script button and return output.

@param taskName name for the task listener
@return script output written to the console
@throws Exception on failure, e.g. timeout
Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/script/AbstractGhidraScriptMgrPluginTest.java