Hi great add-on. I was wondering if you could add some paramets to it, so if I put file name or folder this will be also removed. E.g.:

$ drush cu test test.txt dummy.xxx

..this should cleanup all standards files and this extra 3 (files/directories) as well. What do you think?

Comments

Chris Charlton’s picture

I like the idea. In your example would every instance of "test.txt" be deleted anywhere its found (including sub-directories)?

Your idea of removing a folder by name seems a bit scary since it can cause more damage than good. I'm not saying its not a good idea as an enhancement to this Drush plug-in and maybe we just need to define a flag/syntax that would force people to deliberately delete entire folders by name.

One thought that just came to mind is the fact that some files would have no file extensions so "test" could mean a directory, a file, or both. Need to think this one out a little more but its where this plug-in is headed, that's for sure.

Thoughts?

Chris Charlton’s picture

Status: Active » Postponed (maintainer needs more info)
TheDoctor’s picture

@Chris:

Great idea; flags/switches should be enforced IMO. Perhaps a "sudo"-like function or simply use "-n" or -"y" accordingly (preferred as other Drush aspects use this methodology).

... or maybe a "mv" to ~/drupal_trashcan instead of deletion?

sobi3ch’s picture

n your example would every instance of "test.txt" be deleted anywhere its found (including sub-directories)?

No, I rather think about this similar to the linux shell. U could add switches like -R (recursive) for sub-directories.

One thought that just came to mind is the fact that some files would have no file extensions so "test" could mean a directory, a file, or both.

most of the files (mayby all) have extensions like .module .install etc. To prevent directory from accidental removing plug-in can ask user if he/she are sure they want to remove entire folder . With file without extension it can do the same.

sobi3ch’s picture

Status: Postponed (maintainer needs more info) » Active
Chris Charlton’s picture

I have designed the new version of this plug-in to read an external text file (*.cleanup.ini) and delete the files listed in those files. I have planned for people to supply an option "--file=customfile.cleanup.ini" for custom needs like this.