Created
February 10, 2016 12:35
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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