open-notepad 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/note.js +6 -1
- package/package.json +1 -1
package/bin/note.js
CHANGED
|
@@ -490,7 +490,12 @@ async function handleEdit(codeArg) {
|
|
|
490
490
|
await fs.writeFile(tempFilePath, initialContent, 'utf-8');
|
|
491
491
|
|
|
492
492
|
// Open editor
|
|
493
|
-
|
|
493
|
+
let editor = process.env.EDITOR;
|
|
494
|
+
if (process.platform === 'linux') {
|
|
495
|
+
editor = 'nano';
|
|
496
|
+
} else if (!editor) {
|
|
497
|
+
editor = process.platform === 'win32' ? 'notepad' : 'nano';
|
|
498
|
+
}
|
|
494
499
|
info(`Opening editor: ${colors.bold}${editor}${colors.reset} with note content...`);
|
|
495
500
|
|
|
496
501
|
const child = spawn(editor, [tempFilePath], { stdio: 'inherit', shell: true });
|