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

Commit

Permalink
Merge pull request #1322 from nibblebot/master
Browse files Browse the repository at this point in the history
Allow symlinked output directories
  • Loading branch information
xzyfer committed Jan 2, 2016
2 parents 23d5ba5 + b1f697d commit ec18ef5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bin/node-sass
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ function isDirectory(filePath) {
var isDir = false;
try {
var absolutePath = path.resolve(filePath);
isDir = fs.lstatSync(absolutePath).isDirectory();
isDir = fs.statSync(absolutePath).isDirectory();
} catch (e) {
isDir = e.code === 'ENOENT';
}
Expand Down
18 changes: 18 additions & 0 deletions test/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,24 @@ describe('cli', function() {
});
});

it('should not error if output directory is a symlink', function(done) {
var outputDir = fixture('input-directory/css');
var src = fixture('input-directory/sass');
var symlink = fixture('symlinked-css');
fs.mkdirSync(outputDir);
fs.symlinkSync(outputDir, symlink);
var bin = spawn(cli, [src, '--output', symlink]);

bin.once('close', function() {
var files = fs.readdirSync(outputDir).sort();
assert.deepEqual(files, ['one.css', 'two.css', 'nested'].sort());
var nestedFiles = fs.readdirSync(path.join(outputDir, 'nested'));
assert.deepEqual(nestedFiles, ['three.css']);
rimraf.sync(outputDir);
fs.unlinkSync(symlink);
done();
});
});
});

describe('node-sass in.scss --output path/to/file/out.css', function() {
Expand Down

0 comments on commit ec18ef5

Please sign in to comment.