ZIP up a project on save or when closing the IDE?

I posted this question on Stack Overflow, but thought I should post here too.

My company enforces the use of OneDrive for sync and backup. I'm currently working on a project that has a lot of static data in JSON files. OneDrive blocks JSON files.
Is there any way built into webstorm that I could automatically zip the project folder when I save it or close the IDE? This way I could store that zip in the sync folder and have access to it on my desktop and laptop and have a backup. Not ideal, but better than nothing I suppose.

1 comment
Comment actions Permalink

Hi there,

Automatically on project close -- no (there is no events exposed to user so that he can put "on project open/close" actions).

Manually (any time you want) -- yes. You may create some batch/shell script that will do the job and integrate it into IDE via External Tools functionality. Then, when ready, just execute that entry (could be manually via menu or by pressing some predefined shortcut -- you can assign custom shortcuts to a specific External Tools entry).

P.S.
You could use File Watchers functionality and configure file watcher to launch any command (e.g. batch/shell script that will do such zipping) on file save ... but such operation will be fired for *each* modified watched file, which means .. if you are saving 2 files (in PhpStorm/WebStorm there is no really a "Save this file" command -- only "Save All") then command will be executed 2 times.

0

Please sign in to leave a comment.