Skip to content

Instantly share code, notes, and snippets.

@tracymiranda
Created February 10, 2016 12:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tracymiranda/f20f233b40f1f79b1df2 to your computer and use it in GitHub Desktop.
Save tracymiranda/f20f233b40f1f79b1df2 to your computer and use it in GitHub Desktop.
This script runs with Eclipse EASE Jython engine. It adds a README.md file to all open projects in the workspace, noting if they are a java or python project.
loadModule('/System/Resources')
for iproject in getWorkspace().getProjects():
if not iproject.isOpen():
continue
ifile = iproject.getFile("README.md")
if not ifile.exists():
contents = "# " + iproject.getName() + "\n\n"
if iproject.hasNature("org.eclipse.jdt.core.javanature"):
contents += "A Java Project\n"
elif iproject.hasNature("org.python.pydev.pythonNature"):
contents += "A Python Project\n"
writeFile(ifile, contents)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment