Example #1
0
 def run_command(self, command):
     file_regex = '^(.+\.go):([0-9]+):(?:([0-9]+):)?\s*(.*)'
     getView().window().run_command("exec", {'kill': True})
     getView().window().run_command(
         "exec", {'shell': True, 'cmd': [command],
                  'working_dir': self.project.base_path,
                  'file_regex': file_regex})
Example #2
0
    def executeFile(self):
        gobin = get_go_bin_path()
        if self.type == "RUN":
            command = [gobin, "run", self.file_name]
        elif self.type == "BUILD":
            command = [gobin, "build", "-x", "-v", self.file_name]
        elif self.type == "TEST":
            command = [gobin, "test", self.file_name]
        else:
            sublime.error_message("Unknown command: " + self.type)
            self.restoreEnv()
            return

        getView().window().run_command("exec", {'kill': True})
        getView().window().run_command("exec", {
            'shell': True,
            'cmd': command,
            'working_dir': os.path.dirname(self.file_name),
            'file_regex': '^(.+\.go):([0-9]+):(?:([0-9]+):)?\s*(.*)',
        })