Example #1
0
    def run(self):
        """
        Runs the "golang_build_terminal" command - invoked by Sublime Text via
        the command palette or sublime.Window.run_command()
        """

        working_dir = _determine_working_dir(self.window)
        if working_dir is None:
            return

        relevant_sources = set([
            'project file', 'project file (os-specific)',
            'golang.sublime-settings', 'golang.sublime-settings (os-specific)'
        ])

        env_overrides = {}
        for var_name in GO_ENV_VARS:
            value, source = golangconfig.setting_value(var_name,
                                                       window=self.window)
            # Only set overrides that are not coming from the user's shell
            if source in relevant_sources:
                env_overrides[var_name] = value

        # Get the PATH from the shell environment and then prepend any custom
        # value so the user's terminal searches all locations
        value, source = golangconfig.setting_value('PATH', window=self.window)
        if source in relevant_sources:
            shell, env = shellenv.get_env()
            env_overrides['PATH'] = value + os.pathsep + env.get('PATH', '')

        newterm.launch_terminal(working_dir, env=env_overrides)
    def public(self, cwd, env, kwargs, description):
        ensure_ui_thread()

        newterm.launch_terminal(cwd, env, **kwargs)

        self.assertTrue(
            sublime.ok_cancel_dialog('Did %s?' % description, 'Yes'))
    def run(self):
        """
        Runs the "golang_build_terminal" command - invoked by Sublime Text via
        the command palette or sublime.Window.run_command()
        """

        working_dir = _determine_working_dir(self.window)
        if working_dir is None:
            return

        relevant_sources = set([
            'project file',
            'project file (os-specific)',
            'golang.sublime-settings',
            'golang.sublime-settings (os-specific)'
        ])

        env_overrides = {}
        for var_name in GO_ENV_VARS:
            value, source = golangconfig.setting_value(var_name, window=self.window)
            # Only set overrides that are not coming from the user's shell
            if source in relevant_sources:
                env_overrides[var_name] = value

        # Get the PATH from the shell environment and then prepend any custom
        # value so the user's terminal searches all locations
        value, source = golangconfig.setting_value('PATH', window=self.window)
        if source in relevant_sources:
            shell, env = shellenv.get_env()
            env_overrides['PATH'] = value + os.pathsep + env.get('PATH', '')

        newterm.launch_terminal(working_dir, env=env_overrides)
 def do_test():
     newterm.launch_terminal(PACKAGE_PATH, {'key': b'value'})
 def do_test():
     newterm.launch_terminal(PACKAGE_PATH.encode('utf-8'))
Example #6
0
 def do_test():
     newterm.launch_terminal(PACKAGE_PATH, {'key': b'value'})
Example #7
0
 def do_test():
     newterm.launch_terminal(PACKAGE_PATH.encode('utf-8'))
Example #8
0
    def public(self, cwd, env, kwargs, description):
        ensure_ui_thread()

        newterm.launch_terminal(cwd, env, **kwargs)

        self.assertTrue(sublime.ok_cancel_dialog('Did %s?' % description, 'Yes'))