Exit editSub with unset or empty $EDITOR
This commit is contained in:
parent
dad6d54d20
commit
34e6d5fee6
6
sub.py
6
sub.py
@ -39,7 +39,11 @@ def editSub(num):
|
|||||||
sub = getSub(getItem(num))
|
sub = getSub(getItem(num))
|
||||||
if sub is None:
|
if sub is None:
|
||||||
sys.exit("This item does not have a sub")
|
sys.exit("This item does not have a sub")
|
||||||
editor = os.getenv("EDITOR").split()
|
editor = os.getenv("EDITOR")
|
||||||
|
if editor is not None and editor != "":
|
||||||
|
editor = editor.split()
|
||||||
|
else:
|
||||||
|
sys.exit("$EDITOR is unset, cannot edit")
|
||||||
subprocess.call(editor + [os.path.join(os.getenv("TODO_DIR"), sub[0], sub[1])])
|
subprocess.call(editor + [os.path.join(os.getenv("TODO_DIR"), sub[0], sub[1])])
|
||||||
|
|
||||||
def showSub(item, indent=0, color=True):
|
def showSub(item, indent=0, color=True):
|
||||||
|
Loading…
Reference in New Issue
Block a user