Inspired by VScode's tasks feature.
Currently this plugin is not added to Package Control, so you need to install it manually. Clone in Sublime's packages directory (Preferences -> Browse Packages) this repo. E.g. for Ubuntu users it may be:
cd ~/.config/sublime-text-3/Packages
git clone https://github.com/arthur-s/FileTasks.git
Real world example - copy files from laptop to remote server:
{
"tasks": {
"copy example.com": { // name of task
"command": "scp __file__ example.com:/home/arthur/project/__relative_file_path__",
"workdir": "/home/arthur/work" //optionally you may set workdir
},
}
}
Reserved words are tasks
, command
and workdir
.
You may use variables in command string. Variables looks like __var__ (with double underscores in both ends). Variables list is (and with what it will be replaced, if your active opened file is /home/arthur/work/project/app1/models/model.js
):
- __file__ - replaces with file full path (
/home/arthur/work/project/app1/models/model.js
) - __filename__ - replaces with file name (
model.js
) - __filedir__ - file's direcrory path (
/home/arthur/work/project/app1/models
) - __relative_file_path__ - if
workdir
is set,workdir
will be cutted from fullpath (if workdir is/home/arthur/work
, then__relative_file_path__
will be replaced withproject/app1/models/model.js
)
- show response message when tasks finishes
- show error when command fails
- add debug mode
- add ability to do tasks for directories in project