Skip to content

Instantly share code, notes, and snippets.

@akuzemchak
Created August 13, 2011 15:30
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 akuzemchak/1143956 to your computer and use it in GitHub Desktop.
Save akuzemchak/1143956 to your computer and use it in GitHub Desktop.
Delete non-empty folder in Sublime Text 2
# add this to the main command array...
{ "caption": "Delete Folder and Contents", "command": "delete_folder_recursive", "args": {"dirs": []} }
# add the following class...
class DeleteFolderRecursiveCommand(sublime_plugin.WindowCommand):
from shutil import rmtree
def run(self, dirs):
try:
rmtree(dirs[0])
except:
sublime.status_message("Folder could not be deleted")
def is_visible(self, dirs):
return len(dirs) == 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment