Osmose / advanced-open-file

Open files and folders in Atom easily.
https://atom.io/packages/advanced-open-file
Other
118 stars 20 forks source link

Would be nice if plugin would create directories. #70

Closed jeffschwartz closed 8 years ago

jeffschwartz commented 8 years ago

Entering /somepath/projectdirectory/newdirectory/ isn't currently supported but would be very nice to have.

Osmose commented 8 years ago

Thanks for the suggestion! I've considered this in the past, and I decided not to include it because:

  1. If you're not opening a file, we don't have a good way to give the user feedback that the directory was created successfully.
  2. Wanting to create an empty directory happens so rarely, you almost always want to create a file in it as well.

But faced with the idea again, those seem like bad reasons vs the fact that it'd be fairly easy to include and could be useful, and is a reasonable thing to have since we already can make directories that don't exist while creating new files. Hmmmmmmmm.

jeffschwartz commented 8 years ago

I recall that the sublime plugin did support this. As for usefulness, well that is, of course, subjective but a common scenario for me and for others is creating the project folder in the terminal, then starting atom from the command line and then adding the folders needed for the project. Another scenario is creating folders for files that don't yet exist, such as those that will be created by task runners like Grunt & Gulp, for example, or by other similar automation tools. The feature could be made a configurable one by adding a config option for it and defaulting it to false so as not to break current users' perceived expectation of the plugin's behavior but that is, of course, totally up to you.

Btw, thanks for considering it.

Osmose commented 8 years ago

This should be fixed on master and will ship with the next release. I took your advice and made it a setting that defaults to false to avoid surprising users who are used to the default behavior.

Thanks again for the suggestion!

jeffschwartz commented 8 years ago

@Osmose thank you so much for this and for your contribution to Atom and the community. Awesome!