MCPcopy Create free account
hub / github.com/gitless-vcs/gitless / _launch_editor

Function _launch_editor

gitless/cli/commit_dialog.py:66–81  ·  view source on GitHub ↗
(fp, repo)

Source from the content-addressed store, hash-verified

64
65
66def _launch_editor(fp, repo):
67 try:
68 editor = repo.config['core.editor']
69 except KeyError:
70 editor = os.environ['EDITOR'] if 'EDITOR' in os.environ else 'vim'
71
72 cmd = shlex.split(editor)
73 cmd.append(fp)
74
75 try:
76 ret = subprocess.call(cmd)
77 if ret != 0:
78 pprint.err('Call to editor {0} failed'.format(editor))
79 except OSError:
80 pprint.err('Couldn\'t launch editor {0}'.format(editor))
81 pprint.err_exp('change the value of git\'s core.editor setting')
82
83
84def _extract_msg(repo):

Callers 1

showFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected