when I bind the shortcut key like this:
[{"keys": ["f4"], "command": "gulp", "args": { "task_name": "detault" }}]
I press f4,the log show“ can't find the gulpfile”,because it will directly find gulpfile from root path.
so I add some code like this in base_command.py
def run(self, task_name=None, task_flag=None, silent=False, paths=[]):
self.setup_data_from_settings()
self.task_name = task_name
self.task_flag = task_flag if task_name is not None and task_flag is not None else self.get_flag_from_task_name()
self.silent = silent
self._working_dir = ""
view = sublime.active_window().active_view()
if len(paths) < 1:
paths= [view.file_name()]
self.sercheable_folders = [os.path.dirname(path) for path in paths] if len(paths) > 0 else self.window.folders()
self.output_view = None
self.work()
after this, it will find gulpfile from active_view
when I bind the shortcut key like this:
[{"keys": ["f4"], "command": "gulp", "args": { "task_name": "detault" }}]
I press f4,the log show“ can't find the gulpfile”,because it will directly find gulpfile from root path. so I add some code like this in base_command.pyafter this, it will find gulpfile from active_view