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

Fix --include-path option. (typo instead of --include-paths). #153

Merged
merged 1 commit into from
Sep 10, 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
8 changes: 4 additions & 4 deletions lib/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ exports = module.exports = function(args) {
outFile = options.outFile = path.join(cwd, path.basename(inFile, '.scss') + '.css');
}

// make sure it's an array
options.includePaths = argv['include-paths'];
// make sure it's an array.
options.includePaths = argv['include-path'];
if (!Array.isArray(options.includePaths)) {
options.includePaths = [options.includePaths];
}
Expand All @@ -104,11 +104,11 @@ exports = module.exports = function(args) {
var watchDir = argv.w;

if (watchDir === true) {
watchDir = []
watchDir = [];
} else if (!Array.isArray(watchDir)) {
watchDir = [watchDir];
}
watchDir.push(inFile)
watchDir.push(inFile);

var throttledRender = throttle(render, options, emitter);

Expand Down
10 changes: 7 additions & 3 deletions test/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,15 @@ describe('cli', function() {
});
});

it('should compile with --include-paths option', function(done){
var emitter = cli(['--include-paths', __dirname + '/lib', __dirname + '/include_path.scss']);
it('should compile with --include-path option', function(done){
var emitter = cli([
'--include-path', __dirname + '/lib',
'--include-path', __dirname + '/functions',
__dirname + '/include_path.scss'
]);
emitter.on('error', done);
emitter.on('render', function(css){
assert.equal(css.trim(), 'body {\n background: red; }');
assert.equal(css.trim(), 'body {\n background: red;\n color: blue; }');
fs.unlink(process.cwd() + '/include_path.css', done);
});
});
Expand Down
3 changes: 3 additions & 0 deletions test/functions/colorBlue.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@function colorBlue() {
@return #0000FF;
}
3 changes: 2 additions & 1 deletion test/include_path.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@import "vars";
@import "colorBlue";

body { background: $color; }
body { background: $color; color: colorBlue(); }
4 changes: 2 additions & 2 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ describe("compile file with include paths", function(){
it("should compile with render", function(done) {
sass.render({
file: path.resolve(__dirname, "include_path.scss"),
includePaths: [path.resolve(__dirname, "lib")],
includePaths: [path.resolve(__dirname, "lib"), path.resolve(__dirname, "functions")],
success: function (css) {
done(assert.equal(css, "body {\n background: red; }\n"));
done(assert.equal(css, "body {\n background: red;\n color: blue; }\n"));
},
error: function (error) {
done(error);
Expand Down