You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

antRun.pl 1.4 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #!/usr/bin/perl
  2. #######################################################################
  3. #
  4. # antRun.pl
  5. #
  6. # wrapper script for invoking commands on a platform with Perl installed
  7. # this is akin to antRun.bat, and antRun the SH script
  8. #
  9. # created: 2001-10-18
  10. # last modified: 2001-11-13
  11. # author: Jeff Tulley jtulley@novell.com
  12. #######################################################################
  13. #be fussy about variables
  14. use strict;
  15. #turn warnings on during dev; generates a few spurious uninitialised var access warnings
  16. #use warnings;
  17. #and set $debug to 1 to turn on trace info (currently unused)
  18. my $debug=1;
  19. #######################################################################
  20. # change drive and directory to "%1"
  21. my $ANT_RUN_CMD = @ARGV[0];
  22. # assign current run command to "%2"
  23. chdir (@ARGV[0]) || die "Can't cd to $ARGV[0]: $!\n";
  24. if ($^O eq "NetWare") {
  25. # There is a bug in Perl 5 on NetWare, where chdir does not
  26. # do anything. On NetWare, the following path-prefixed form should
  27. # always work. (afaict)
  28. $ANT_RUN_CMD .= "/".@ARGV[1];
  29. }
  30. else {
  31. $ANT_RUN_CMD = @ARGV[1];
  32. }
  33. # dispose of the first two arguments, leaving only the command's args.
  34. shift;
  35. shift;
  36. # run the command
  37. my $returnValue = system $ANT_RUN_CMD, @ARGV;
  38. if ($returnValue eq 0) {
  39. exit 0;
  40. }
  41. else {
  42. # only 0 and 1 are widely recognized as exit values
  43. # so change the exit value to 1
  44. exit 1;
  45. }