comparison scripts/miscellaneous/run.m @ 10549:95c3e38098bf

Untabify .m scripts
author Rik <code@nomad.inbox5.com>
date Fri, 23 Apr 2010 11:28:50 -0700
parents f22bbc5d56e9
children 0754a4e271f4
comparison
equal deleted inserted replaced
10548:479536c5bb10 10549:95c3e38098bf
35 [d, f, ext] = fileparts (s); 35 [d, f, ext] = fileparts (s);
36 if (! isempty (d)) 36 if (! isempty (d))
37 if (exist (d, "dir")) 37 if (exist (d, "dir"))
38 wd = pwd (); 38 wd = pwd ();
39 unwind_protect 39 unwind_protect
40 cd (d); 40 cd (d);
41 if (! exist (f, "file") || ! strcmp (ext, ".m")) 41 if (! exist (f, "file") || ! strcmp (ext, ".m"))
42 error ("run: file must exist and be a valid Octave script file"); 42 error ("run: file must exist and be a valid Octave script file");
43 endif 43 endif
44 evalin ("caller", [f, ";"], "rethrow (lasterror ())"); 44 evalin ("caller", [f, ";"], "rethrow (lasterror ())");
45 unwind_protect_cleanup 45 unwind_protect_cleanup
46 cd (wd); 46 cd (wd);
47 end_unwind_protect 47 end_unwind_protect
48 else 48 else
49 error ("run: the path %s doesn't exist", d); 49 error ("run: the path %s doesn't exist", d);
50 endif 50 endif
51 else 51 else