Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit c4f60ffa5beb67880dd23a541ac40f339c6cc09f 1 parent 029cacc
@arobson arobson authored
View
8 lib/uglify.js
@@ -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
4 package.json
@@ -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
9 spec/plugin.spec.js
@@ -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
6 src/uglify.js
@@ -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" );
+ }
}
} );
};
Please sign in to comment.
Something went wrong with that request. Please try again.