Skip to content

Commit

Permalink
Fixed some path.join()s
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Aug 16, 2011
1 parent b064ea4 commit 9d470f3
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions bin/stylus
Original file line number Diff line number Diff line change
Expand Up @@ -255,11 +255,8 @@ function help(name) {
}

switch (process.platform) {
case 'linux':
command = 'x-www-browser';
break;
default:
command = 'open';
case 'linux': command = 'x-www-browser'; break;
default: command = 'open';
}

exec(command + ' "' + url + '"', function(){
Expand Down Expand Up @@ -315,7 +312,7 @@ if (convertCSS) {
*/

function repl() {
var options = { filename: 'stdin', imports: [__dirname + '/../lib/functions'] }
var options = { filename: 'stdin', imports: [join(__dirname, '..', 'lib', 'functions')] }
, parser = new stylus.Parser('', options)
, evaluator = new stylus.Evaluator(parser.parse(), options)
, rl = require('readline')
Expand Down Expand Up @@ -508,7 +505,7 @@ function compileFile(file) {
files.filter(function(path){
return path.match(/\.styl$/);
}).map(function(path){
return file + '/' + path;
return join(file, path);
}).forEach(compileFile);
});
}
Expand All @@ -522,7 +519,7 @@ function compileFile(file) {
function writeFile(file, css) {
// --out support
var path = dest
? dest + '/' + basename(file, '.styl') + '.css'
? join(dest, basename(file, '.styl') + '.css')
: file.replace('.styl', '.css');
fs.writeFile(path, css, function(err){
if (err) throw err;
Expand Down

0 comments on commit 9d470f3

Please sign in to comment.