Sublime Text Plugin - Publish files automatically to another folder

2

Does anyone know of a plugin for Sublime Text 2 that somehow publishes the modified files in a given folder?

Another application that has this feature is Dreamweaver.

    
asked by anonymous 15.04.2014 / 22:16

1 answer

2

I use a build system . It's fast, easy and simple. :)

I use Windows 8, but the principle is the same for other operating systems (and there are more details in the documentation I referenced above):

  • Create a specific build file for your project (for example, meuProjeto.sublime-build ) in the Packages\User directory from the installation (in case Windows is set to User\AppData\Roaming\Sublime Text 3\Packages\User ).

  • Add to this file a command tag for executing a script file (in the case of Windows, a batch file). For example:

{
    "cmd": ["C:\CAMINHO\DO\SCRIPT\meuProjeto-copiaArquivos.bat"]
}
  • Then, create the script file in the path and with the name previously configured, adding the necessary commands to copy the files of your project.

I use this scheme to copy Web project files using the xcopy command to a Wamp Server folder, and then automatically opening Google Chrome on localhost :

@echo off
xcopy /E /Y /A C:\CAMINHO\DO\PROJETO\*.* C:\wamp\www\MeuProjeto\
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" "http://localhost/"

Then you probably need to reboot Sublime Text, but the new build system can be selected from the Tools -> Build System menu and run from the Tools -> Build menu.

    
15.04.2014 / 23:48