I'm sick of having to type (cd ..; perl mkfiles.pl) when I'm working
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Sat, 29 Mar 2003 17:07:31 +0000 (17:07 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Sat, 29 Mar 2003 17:07:31 +0000 (17:07 +0000)
on Unix. So now mkfiles.pl will look in .. as well as . when
searching for Recipe, so I can run `perl ../mkfiles.pl' and it will
Just Work.

git-svn-id: svn://svn.tartarus.org/sgt/putty@3016 cda61777-01e9-0310-a592-d414129be87e

mkfiles.pl

index f2c660b..438495b 100755 (executable)
@@ -9,7 +9,13 @@
 
 use FileHandle;
 
-open IN, "Recipe" or die "unable to open Recipe file\n";
+open IN, "Recipe" or do {
+    # We want to deal correctly with being run from one of the
+    # subdirs in the source tree. So if we can't find Recipe here,
+    # try one level up.
+    chdir "..";
+    open IN, "Recipe" or die "unable to open Recipe file\n";
+};
 
 # HACK: One of the source files in `charset' is auto-generated by
 # sbcsgen.pl. We need to generate that _now_, before attempting