Advertisement
Guest User

Untitled

a guest
May 20th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. #!/bin/perl
  2. # use strict;
  3. use warnings;
  4.  
  5. use File::stat;
  6.  
  7. format STDOUT_TOP =
  8. Size | Diff | Delta | Path
  9. --------------------------------------------------------------
  10. .
  11.  
  12. format STDOUT =
  13. @>>>>>>>>> @>>>>>>>>> @##.##% @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  14. $size, $diff, $delta, $path
  15. .
  16.  
  17. my $lastsize;
  18.  
  19. foreach ( glob('../0.*.*/bundles/cjs/pkg.js') ) {
  20. $size = stat($_)->size;
  21.  
  22. if(!$lastsize) {
  23. $lastsize = $size;
  24. }
  25.  
  26. $diff = $size - $lastsize;
  27.  
  28. $delta = ($size - $lastsize) / $lastsize * 100;
  29. $lastsize = $size;
  30.  
  31. $path = $_;
  32. write;
  33. }
  34.  
  35. $lastsize = 0;
  36.  
  37. print "\n";
  38.  
  39. foreach ( glob('../0.*.*/bundles.terse/cjs/pkg.js') ) {
  40. $size = stat($_)->size;
  41.  
  42. if(!$lastsize) {
  43. $lastsize = $size;
  44. }
  45.  
  46. $diff = $size - $lastsize;
  47.  
  48. $delta = ($size - $lastsize) / $lastsize * 100;
  49. $lastsize = $size;
  50.  
  51. $path = $_;
  52. write;
  53. }
  54.  
  55.  
  56. # foreach (glob('../0.*.*/bundles.terse/cjs/pkg.js')) {
  57. # print `wc -c $_`
  58. # write;
  59. # }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement