Sublime Forum

Automatically create folder of same name on file is creation

#1

Is there anyway for me to set up sublime to automatically create a folder of the same name when I create certain files.

I create landing pages that all have a “_lp” prefix to the filename, I would like to watch for when a file with this name is created and then automatically create a folder of the same name in another directory (for css and images).

Would this be possible with a plugin or something like Grunt?

0 Likes

#2

Both, most likely. I don’t use Grunt however.

For Sublime Text, you can just hook the on_post_save, check the filename via view.file_name() and then use some os module function to create the directory if it doesn’t exist already.

0 Likes