Permalink
Browse files

Bug fix to stop it from adding .min forever in CI mode. *facepalm*

  • Loading branch information...
1 parent 029cacc commit c4f60ffa5beb67880dd23a541ac40f339c6cc09f @arobson arobson committed Oct 30, 2012
Showing with 14 additions and 13 deletions.
  1. +6 −2 lib/uglify.js
  2. +2 −2 package.json
  3. +1 −8 spec/plugin.spec.js
  4. +5 −1 src/uglify.js
View
@@ -1,6 +1,6 @@
/*
anvil.uglify - Uglify plugin for anvil.js
- version: 0.0.8
+ version: 0.0.9
author: Alex Robson <alex@sharplearningcurve.com> (http://sharplearningcurve.com)
copyright: 2011 - 2012
license: Dual licensed
@@ -144,7 +144,11 @@ var uglifyFactory = function( _, anvil ) {
},
rename: function( name ) {
- return name.replace( ".js", ".min.js" );
+ if( name.match( /[.]min[.]js$/ ) ) {
+ return name;
+ } else {
+ return name.replace( ".js", ".min.js" );
+ }
}
} );
};
View
@@ -2,7 +2,7 @@
"author": "Alex Robson <alex@sharplearningcurve.com> (http://sharplearningcurve.com)",
"name": "anvil.uglify",
"description": "Uglify plugin for anvil.js",
- "version": "0.0.8",
+ "version": "0.0.9",
"repository": {
"type": "git",
"url": "git://github.com/arobson/anvil.uglify.git"
@@ -26,4 +26,4 @@
],
"optionalDependencies": {},
"keywords": [ "anvil", "uglify" ]
-}
+}
View
@@ -3,18 +3,13 @@ var _ = require( "underscore" );
var api = require( "anvil.js" );
var Harness = api.PluginHarness;
-var harness = new Harness( "anvil.uglify", "/git/js/anvil/anvil.uglify" ),
+var harness = new Harness( "anvil.uglify", "./" ),
tests = [];
-// harness.addFile( "./build.json",
-// '{ "anvil.uglify": { "all": true } }' );
-
harness.addCommandArgs( "--uglify" );
-
harness.addFile( "./src/test.js",
"var x = 10;\n" +
"var y = 5;" );
-
harness.expectFile( "./lib/test.min.js",
"var x=10,y=5" );
@@ -27,7 +22,6 @@ describe( "when uglifying", function() {
},
function( results ) {
tests = results;
- console.log( api.files.files );
done();
}
);
@@ -38,5 +32,4 @@ describe( "when uglifying", function() {
test.call();
} );
} );
-
} );
View
@@ -135,7 +135,11 @@ var uglifyFactory = function( _, anvil ) {
},
rename: function( name ) {
- return name.replace( ".js", ".min.js" );
+ if( name.match( /[.]min[.]js$/ ) ) {
+ return name;
+ } else {
+ return name.replace( ".js", ".min.js" );
+ }
}
} );
};

0 comments on commit c4f60ff

Please sign in to comment.