]> mj.ucw.cz Git - bex.git/commitdiff
Make editor configurable
authorMartin Mares <mj@ucw.cz>
Fri, 14 Jun 2013 15:08:52 +0000 (17:08 +0200)
committerMartin Mares <mj@ucw.cz>
Fri, 14 Jun 2013 15:08:52 +0000 (17:08 +0200)
lib/bin/bex-add
lib/perl/BEX/Config.pm

index 4f2c3b39138822594dac031e807c298db4637814..d984d60ecf9a93dbed78e992e59ec7edcd46a1b6 100755 (executable)
@@ -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;
index c5a422df1c658cbe858318a90f339b83d0e23ad3..1709f7b557d53533c35ab96ec33c9f6b26d74416 100644 (file)
@@ -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(@);