1#!
2#[[BEGIN PROPERTIES]]
3# Type = Command
4# Order = 1.0
5# Interpreter = perl
6# Caption = Run
7# Descr =Run a file.
8# Descr =
9# Descr =Selection details:
10# Descr =
11# Descr =  Source: Ignored.
12# Descr =
13# Descr =  Target: The file to be run. It should be an executable.
14# Descr =
15# Descr =Hint: The current working directory is set to the parent
16# Descr =directory of the target file.
17# Icon = run.tga
18# Hotkey = Ctrl+R
19#[[END PROPERTIES]]
20
21use strict;
22use warnings;
23BEGIN { require "$ENV{'EM_DIR'}/res/emFileMan/scripts/cmd-util.pl"; }
24
25ErrorIfNotSingleTarget();
26ErrorIfTargetsNotFiles();
27
28my @tgt=GetTgt();
29
30Confirm(
31	"Run",
32	"Are you sure to run:\n".
33	"\n".
34	"$tgt[0]\n"
35);
36
37ChDirOrError(dirname($tgt[0]));
38
39ExecOrError($tgt[0]);
40