Use default editors if EDITOR is not set, improve windows compatibility

main
Jordi Boggiano 12 years ago
parent 0615455087
commit d00d7eef7f

@ -115,9 +115,13 @@ EOT
{ {
// Open file in editor // Open file in editor
if ($input->getOption('editor')) { if ($input->getOption('editor')) {
// @todo Find a way to use another editor $editor = getenv('EDITOR');
$editor = system("bash -cl 'echo \$EDITOR'"); if (!$editor) {
system($editor . ' ' . $this->configFile->getPath() . ' > `tty`'); $editor = defined('PHP_WINDOWS_VERSION_BUILD') ? 'notepad' : 'vi';
}
system($editor . ' ' . $this->configFile->getPath() . (defined('PHP_WINDOWS_VERSION_BUILD') ? '': ' > `tty`'));
return 0; return 0;
} }

Loading…
Cancel
Save