merging
[urisagit/Stem.git] / bin / hello_demo
old mode 100644 (file)
new mode 100755 (executable)
index 5b525c1..313c5c1
@@ -4,13 +4,15 @@ use strict ;
 use warnings ;
 our $s ;
 
-if ( -d 'conf' && -e 'bin/run_stem' ) {
+print "HELLO DEMO\n" ;
 
-       $ENV{PERL5LIB} = 'lib' ;
-       $ENV{PATH} =  "bin:$ENV{PATH}" ;
+use File::Basename qw( basename );
+$ENV{PATH} .= ':' . basename( $0 ) . ':.';
+for my $prog qw( run_stem xterm ) {
+    die "Can't find $prog in PATH\n" if
+        system( "which $prog >/dev/null 2>&1" ) != 0;
 }
 
-print "HELLO DEMO\n" ;
 
 $SIG{ 'INT' } = \&cleanup ;
 
@@ -30,12 +32,11 @@ s/:/: / for @cmd ;
 
 fork_exec( @cmd ) ;
 
-while( <STDIN> ) {
+1 while wait() != -1;
+
+exit;
 
-       next unless /^q/i ;
 
-       cleanup() ;
-}
 
 sub cleanup {