Permalink
Browse files

Merge branch 'master' of github.com:vicapow/sails

Conflicts:
	lib/assets.js
  • Loading branch information...
2 parents 8ff53c1 + 74ac6ab commit 0ce89b235df9874113dbd10397905a7c4eabcd90 @vicapow committed Mar 19, 2013
Showing with 34 additions and 34 deletions.
  1. +34 −34 lib/assets.js
View
68 lib/assets.js
@@ -83,44 +83,44 @@ var CssAsset = rack.Asset.extend({
}, function(error) {
if(error) self.emit('error', error);
var parser = new less.Parser({
- paths : _.map(sails.config.assets.sequence, function(asset_path){
- return pathutil.join(sails.config.appPath, asset_path)
- })
+ paths : _.map(sails.config.assets.sequence, function(asset_path){
+ return pathutil.join(sails.config.appPath, asset_path)
+ })
});
try{
- parser.parse(self.lessContents, function(error, tree) {
- if (error) {
- if(!(error instanceof Error)){
- less.writeError(error)
- error = new Error("Less asset compilation error");
+ parser.parse(self.lessContents, function(error, tree) {
+ if (error) {
+ if(!(error instanceof Error)){
+ less.writeError(error)
+ error = new Error("Less asset compilation error");
+ }
+ return self.emit('error', error);
}
- return self.emit('error', error);
- }
- var lessAsset = new rack.Asset({
- url: '/assets/styles/style.less.css',
- mimetype: 'text/css',
- contents: tree.toCSS()
- });
- lessAsset.isDev = true;
- self.assets.push(lessAsset);
- lessAsset.on('complete', function() {
- self.contents = '';
- if (isProduction) {
- _.each(self.assets, function(asset) {
- self.contents += asset.contents += '\n';
- });
- self.contents = cleancss.process(self.contents);
- }
- self.isDev = false;
- self.emit('created');
- });
- });
+ var lessAsset = new rack.Asset({
+ url: '/assets/styles/style.less.css',
+ mimetype: 'text/css',
+ contents: tree.toCSS()
+ });
+ lessAsset.isDev = true;
+ self.assets.push(lessAsset);
+ lessAsset.on('complete', function() {
+ self.contents = '';
+ if (isProduction) {
+ _.each(self.assets, function(asset) {
+ self.contents += asset.contents += '\n';
+ });
+ self.contents = cleancss.process(self.contents);
+ }
+ self.isDev = false;
+ self.emit('created');
+ });
+ });
}catch(error){
- if(!(error instanceof Error)){
- less.writeError(error);
- error = new Error("Less asset compilation error");
- }
- return self.emit('error', error);
+ if(!(error instanceof Error)){
+ less.writeError(error);
+ error = new Error("Less asset compilation error");
+ }
+ return self.emit('error', error);
}
});
}

0 comments on commit 0ce89b2

Please sign in to comment.