Fallback to nano if no editor is set (#517)

* Fallback to nano if no editor is set

* Add notepad fallback for windows

* Remove padding

* Use constant instead of var
This commit is contained in:
James Hall 2016-07-30 18:10:01 +01:00 committed by Guillermo Rauch
parent e4042d0628
commit c95ca509f3

View file

@ -137,6 +137,7 @@ export function moveTo (i) {
}
export function showPreferences () {
const editorFallback = process.platform === 'win32' ? 'notepad' : 'nano';
return (dispatch, getState) => {
dispatch({
type: UI_SHOW_PREFERENCES,
@ -150,7 +151,7 @@ export function showPreferences () {
// Leading space prevents command to be store in shell history
[' echo Attempting to open ~/.hyperterm.js with your \$EDITOR', // eslint-disable-line no-useless-escape
' echo If it fails, open it manually with your favorite editor!',
' bash -c "exec env $EDITOR ~/.hyperterm.js"',
' bash -c "exec env ${EDITOR:=' + editorFallback + '} ~/.hyperterm.js"',
''
].join('\n')
));