fixVersion 889 B

1234567891011121314151617181920212223
  1. #! /usr/bin/perl
  2. #
  3. # grep -l -r -i ' "\?version"\?\(:\| =\) "' unpacked/ test package.json | grep -v "/local/" | xargs -L 1 ./fixVersion x.y.z
  4. #
  5. $V = shift;
  6. foreach $file (@ARGV) {
  7. next if ($file =~ m/\/config\//);
  8. next if ($file =~ m/\/extensions\/TeX\/mhchem3\//);
  9. next if ($file =~ m/\/extensions\/a11y\//);
  10. open(INFILE,"<",$file) || die "Can't open '$file' for reading: $!\n";
  11. @lines = <INFILE>; close(INFILE);
  12. $lines = join("",@lines);
  13. $lines =~ s/( "?version"?(:| =) ")\d+(\.\d+)*(-beta([-.]\d+)?)?"/$1$V"/gi;
  14. $lines =~ s/MathJax.version = "\d+(\.\d+)*(-beta([-.]\d+)?)?"/MathJax.version = "$V"/;
  15. $lines =~ s/MathJax.fileversion = "\d+(\.\d+)*(-beta([-.]\d+)?)?"/MathJax.fileversion = "$V"/;
  16. $lines =~ s/MathJax.cdnVersion = "(\d+(\.\d+)*(-beta([-.]\d+)?)?)?"/MathJax.cdnVersion = "$V"/;
  17. open(OUTFILE,">",$file);
  18. print OUTFILE $lines;
  19. close(OUTFILE);
  20. }