diff auto-weave.pl @ 8:73beed20f7de

going to move refreshing the page to auto-weave
author Robert McIntyre <rlm@mit.edu>
date Tue, 25 Oct 2011 01:08:31 -0700
parents ce96610fe058
children d09937a6cb4b
line wrap: on
line diff
     1.1 --- a/auto-weave.pl	Mon Oct 24 09:41:38 2011 -0700
     1.2 +++ b/auto-weave.pl	Tue Oct 25 01:08:31 2011 -0700
     1.3 @@ -11,7 +11,7 @@
     1.4  @org_files =  glob("./org/*.org");
     1.5  
     1.6  $" = "\n";
     1.7 -print "@org_files";
     1.8 +print "@org_files\n";
     1.9  
    1.10  
    1.11  foreach(@org_files){
    1.12 @@ -21,22 +21,26 @@
    1.13    my $e = shift;
    1.14    my $name = $e->fullname;
    1.15    print "$name was modified\n" if $e->IN_MODIFY;
    1.16 -  `weave $name`;
    1.17 +  system ("weave $name");
    1.18 +  print ("$name\n");
    1.19 +  $path = `readlink -f $name`;
    1.20 +  $path =~ s|/home/r/proj|http://aurellem.localhost|;
    1.21 +  print ("$path\n");
    1.22 +  $path =~ s|org|html|g;
    1.23 +  print ("$path\n");
    1.24 +  system ("firefox $path");
    1.25 +
    1.26  });
    1.27 -
    1.28 -
    1.29 -
    1.30 -
    1.31  }
    1.32  
    1.33  
    1.34  
    1.35  
    1.36  # integration into AnyEvent (works with EV, Glib, Tk, POE...)
    1.37 -my $inotify_w = AnyEvent->io 
    1.38 -  (
    1.39 -   fh => $inotify->fileno, poll => 'r', cb => sub { $inotify->poll }
    1.40 -  );
    1.41 +#my $inotify_w = AnyEvent->io 
    1.42 +#  (
    1.43 +#   fh => $inotify->fileno, poll => 'r', cb => sub { $inotify->poll }
    1.44 +#  );
    1.45  
    1.46   # manual event loop
    1.47  1 while $inotify->poll;