简体   繁体   中英

Preprocessing files before upload to FTP

I'm using phpStorm to develop and I want to process some files before it's uploaded to the FTP server.

For example, I want to strip all comments on PHP files or even compress/obfuscate it, or minify css and js.

I know that there are some plugins to minify css and js, but I don't want to do this over my local files, I just want to upload it processed, but leave untouched my files.

I'm currently using Git, so when I commit a change, all affected files are automatically uploaded to the FTP server. It could be great to commit the changes, process the files and upload the result to the FTP server.

It could be great to commit the changes, process the files and upload the result to the FTP server.

That would mean, in a post-commit hook :

  • update a separate repo
  • change your files in that separate repo
  • sftp the separate repo content

In other words, you would upload a processed working tree from another local repo, and not from your current local repo (where you don't want to change your files).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM