Skip to content

Commit

Permalink
Fix package node version (testing npm install)
Browse files Browse the repository at this point in the history
Prevent stylus middle tier if the current theme has no stylus folder.
  • Loading branch information
Andreas Richter authored and Andreas Richter committed Aug 6, 2012
1 parent 06debd4 commit 325e3f2
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 18 deletions.
34 changes: 18 additions & 16 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,22 +153,24 @@ function bootApplication(next) {

// Load placeholder, replaced later
if(app.config.get('libraries:stylus:enabled')) {
app.mwHelpers.stylusMiddleware = function (themePath) {
var mw = stylus.middleware({
src: themePath + '/stylus',
dest: themePath + '/public',
debug: false,
compile: function (str, path) { // optional, but recommended
return stylus(str)
.set('filename', path)
.set('warn', app.config.get('libraries:stylus:warn'))
.set('compress', app.config.get('libraries:stylus:compress'));
}
});
mw.tag = 'theme.stylus';
return mw;
};
app.use(app.mwHelpers.stylusMiddleware(''));
if ((fs.existsSync || path.existsSync)(themePatch + '/stylus')) {
app.mwHelpers.stylusMiddleware = function (themePath) {
var mw = stylus.middleware({
src: themePath + '/stylus',
dest: themePath + '/public',
debug: false,
compile: function (str, path) { // optional, but recommended
return stylus(str)
.set('filename', path)
.set('warn', app.config.get('libraries:stylus:warn'))
.set('compress', app.config.get('libraries:stylus:compress'));
}
});
mw.tag = 'theme.stylus';
return mw;
};
app.use(app.mwHelpers.stylusMiddleware(''));
}
}
// Static
app.mwHelpers.staticMiddleware = function (themePath) {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "calipso",
"description": "A NodeJS CMS",
"version": "0.3.0",
"version": "0.3.1",
"homepage": "http://calip.so",
"repository": {
"type": "git",
Expand All @@ -18,7 +18,7 @@
"tests": "./tests"
},
"engines": {
"node": "0.6.x"
"node": ">=0.6||>=0.8"
},
"devDependencies": {
"mocha": "*",
Expand Down

0 comments on commit 325e3f2

Please sign in to comment.