Commits

Joey Smith  committed 3930b32 Merge

Merge pull request #11 from bmouw/patch-1

Fix batch processing for a mix of css and js files. When batch processin

  • Participants
  • Parent commits e6c457c, 96d78a9

Comments (0)

Files changed (1)

File src/com/yahoo/platform/yui/compressor/YUICompressor.java

                 }
             }
 
-            String type = (String) parser.getOptionValue(typeOpt);
-            if (type != null && !type.equalsIgnoreCase("js") && !type.equalsIgnoreCase("css")) {
+            String typeOverride = (String) parser.getOptionValue(typeOpt);
+            if (typeOverride != null && !typeOverride.equalsIgnoreCase("js") && !typeOverride.equalsIgnoreCase("css")) {
                 usage();
                 System.exit(1);
             }
             String[] fileArgs = parser.getRemainingArgs();
             java.util.List files = java.util.Arrays.asList(fileArgs);
             if (files.isEmpty()) {
-                if (type == null) {
+                if (typeOverride == null) {
                     usage();
                     System.exit(1);
                 }
             java.util.Iterator filenames = files.iterator();
             while(filenames.hasNext()) {
                 String inputFilename = (String)filenames.next();
-
+                String type = null;
                 try {
                     if (inputFilename.equals("-")) {
 
 
                     } else {
 
-                        if (type == null) {
+                        if ( typeOverride != null ) {
+                            type = typeOverride;
+                        }
+                        else {
                             int idx = inputFilename.lastIndexOf('.');
                             if (idx >= 0 && idx < inputFilename.length() - 1) {
                                 type = inputFilename.substring(idx + 1);