1#! 2#[[BEGIN PROPERTIES]] 3# Type = Command 4# Order = 3.0 5# Interpreter = perl 6# Caption = Run On Source 7# Descr =Run a file with the source paths as the arguments. 8# Descr = 9# Descr =Selection details: 10# Descr = 11# Descr = Source: The files and directories whose paths are to be 12# Descr = taken as the arguments. 13# Descr = 14# Descr = Target: The file to be run. It should be an executable. 15# Descr = 16# Descr =Hints: Here, the current working directory is set to the 17# Descr =parent directory of the first source argument. The order 18# Descr =of arguments may differ from the order of selecting them. 19# Icon = run_on_source.tga 20# Hotkey = Shift+Ctrl+R 21#[[END PROPERTIES]] 22 23use strict; 24use warnings; 25BEGIN { require "$ENV{'EM_DIR'}/res/emFileMan/scripts/cmd-util.pl"; } 26 27ErrorIfNoSources(); 28ConfirmIfSourcesAcrossDirs(); 29ErrorIfNotSingleTarget(); 30ErrorIfTargetsNotFiles(); 31 32my @src=GetSrc(); 33my @tgt=GetTgt(); 34 35my $message= 36 "Are you sure to take these paths as arguments:\n". 37 "\n". 38 GetSrcListing(). 39 "\n". 40 "And run:\n". 41 "\n". 42 GetTgtListing() 43; 44 45Confirm("Run On Source",$message); 46 47ChDirOrError(dirname($src[0])); 48 49ExecOrError($tgt[0],@src); 50