Move before command down to where params are set

This commit is contained in:
Jamie Cameron 2010-12-14 00:15:37 -08:00
parent a36c3ea7d7
commit ca0b4e1655

View File

@ -8,11 +8,6 @@ $edit = &get_command($in{'id'}, $in{'idx'});
&error_setup($text{'view_err'});
$edit->{'edit'} && &can_run_command($edit) || &error($text{'edit_ecannot'});
# Run the before-command
if ($edit->{'before'}) {
&system_logged("$edit->{'before'} >/dev/null 2>&1 </dev/null");
}
# Work out proper filename
$file = $edit->{'edit'};
if ($file !~ /^\//) {
@ -29,6 +24,11 @@ if ($edit->{'envs'} || @{$edit->{'args'}}) {
chop($file = `echo "$file"`);
}
# Run the before-command
if ($edit->{'before'}) {
&system_logged("$edit->{'before'} >/dev/null 2>&1 </dev/null");
}
# Save the file
$in{'data'} =~ s/\r//g;
&open_lock_tempfile(FILE, ">$file", 1) ||