Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Added safer path handling for Windows #159

Merged
merged 1 commit into from
Sep 26, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions sass.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
var binding;
var fs = require('fs');
var path = require('path');
try {
if (fs.realpathSync(__dirname + '/build')) {
// use the build version if it exists
Expand Down Expand Up @@ -63,11 +64,11 @@ exports.render = function(options) {
options.error = options.error || function(){};

if (options.file !== undefined && options.file !== null) {
return binding.renderFile(options.file, options.success, options.error, newOptions.paths.join(':'), newOptions.style, newOptions.comments);
return binding.renderFile(options.file, options.success, options.error, newOptions.paths.join(path.delimiter), newOptions.style, newOptions.comments);
}

//Assume data is present if file is not. binding/libsass will tell the user otherwise!
return binding.render(options.data, options.success, options.error, newOptions.paths.join(":"), newOptions.style);
return binding.render(options.data, options.success, options.error, newOptions.paths.join(path.delimiter), newOptions.style);
};

exports.renderSync = function(options) {
Expand Down
6 changes: 3 additions & 3 deletions test/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ describe('cli', function() {

it('should compile with --include-path option', function(done){
var emitter = cli([
'--include-path', __dirname + '/lib',
'--include-path', __dirname + '/functions',
__dirname + '/include_path.scss'
'--include-path', path.join(__dirname, '/lib'),
'--include-path', path.join(__dirname, '/functions'),
path.join(__dirname, '/include_path.scss')
]);
emitter.on('error', done);
emitter.on('render', function(css){
Expand Down