CLI: Display error when cannot open note with editor

pull/174/head
Laurent Cozic 2018-01-17 18:10:07 +00:00
parent 1d73f0cdee
commit f632580eed
1 changed files with 3 additions and 1 deletions

View File

@ -81,7 +81,9 @@ class Command extends BaseCommand {
const termState = app().gui().termSaveState();
const spawnSync = require('child_process').spawnSync;
spawnSync(editorPath, editorArgs, { stdio: 'inherit' });
const result = spawnSync(editorPath, editorArgs, { stdio: 'inherit' });
if (result.error) this.stdout(_('Error opening note in editor: %s', result.error.message));
app().gui().termRestoreState(termState);
app().gui().hideModalOverlay();