From: Martin Mares Date: Fri, 14 Jun 2013 15:08:52 +0000 (+0200) Subject: Make editor configurable X-Git-Tag: v3.2~4 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=d29a5492b591dc13f7b89a6ef480d7bdce05d695;p=bex.git Make editor configurable --- diff --git a/lib/bin/bex-add b/lib/bin/bex-add index 4f2c3b3..d984d60 100755 --- a/lib/bin/bex-add +++ b/lib/bin/bex-add @@ -95,7 +95,7 @@ if (defined $requeue_id) { if (!$given_go) { $tmp_fn = $job->save; my $orig_stat = stat($tmp_fn) or die; - system "editor", $tmp_fn and die "Editor exited with an error, file kept as $tmp_fn\n"; + system $BEX::Config::editor_command, $tmp_fn and die "Editor exited with an error, file kept as $tmp_fn\n"; my $new_stat = stat($tmp_fn) or die "File $tmp_fn disappeared under my hands: $!\n"; if ($new_stat->mtime <= $orig_stat->mtime && $new_stat->size == $orig_stat->size) { unlink $tmp_fn; diff --git a/lib/perl/BEX/Config.pm b/lib/perl/BEX/Config.pm index c5a422d..1709f7b 100644 --- a/lib/perl/BEX/Config.pm +++ b/lib/perl/BEX/Config.pm @@ -59,6 +59,9 @@ our $ssh_command = "ssh"; # How we run rsync to upload attachments (including options) our $rsync_command = "rsync -a"; +# Which editor should be used for editing jobs +our $editor_command = $ENV{"EDITOR"} // "/usr/bin/editor"; + # Various utility functions sub parse_machine_list(@);