mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-17 05:58:41 -09:00
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:
parent
e4042d0628
commit
c95ca509f3
1 changed files with 2 additions and 1 deletions
|
|
@ -137,6 +137,7 @@ export function moveTo (i) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function showPreferences () {
|
export function showPreferences () {
|
||||||
|
const editorFallback = process.platform === 'win32' ? 'notepad' : 'nano';
|
||||||
return (dispatch, getState) => {
|
return (dispatch, getState) => {
|
||||||
dispatch({
|
dispatch({
|
||||||
type: UI_SHOW_PREFERENCES,
|
type: UI_SHOW_PREFERENCES,
|
||||||
|
|
@ -150,7 +151,7 @@ export function showPreferences () {
|
||||||
// Leading space prevents command to be store in shell history
|
// 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 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!',
|
' 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')
|
].join('\n')
|
||||||
));
|
));
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue