Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
node-sass
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
楚学文
node-sass
Commits
a3c1124c
Commit
a3c1124c
authored
Sep 26, 2013
by
Andrew Nesbitt
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #159 from LaurentGoderre/add-safer-path-handling
Added safer path handling for Windows
parents
a253ed1f
376524d7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
sass.js
sass.js
+3
-2
cli.js
test/cli.js
+3
-3
No files found.
sass.js
View file @
a3c1124c
var
binding
;
var
binding
;
var
fs
=
require
(
'fs'
);
var
fs
=
require
(
'fs'
);
var
path
=
require
(
'path'
);
try
{
try
{
if
(
fs
.
realpathSync
(
__dirname
+
'/build'
))
{
if
(
fs
.
realpathSync
(
__dirname
+
'/build'
))
{
// use the build version if it exists
// use the build version if it exists
...
@@ -63,11 +64,11 @@ exports.render = function(options) {
...
@@ -63,11 +64,11 @@ exports.render = function(options) {
options
.
error
=
options
.
error
||
function
(){};
options
.
error
=
options
.
error
||
function
(){};
if
(
options
.
file
!==
undefined
&&
options
.
file
!==
null
)
{
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!
//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
)
{
exports
.
renderSync
=
function
(
options
)
{
...
...
test/cli.js
View file @
a3c1124c
...
@@ -62,9 +62,9 @@ describe('cli', function() {
...
@@ -62,9 +62,9 @@ describe('cli', function() {
it
(
'should compile with --include-path option'
,
function
(
done
){
it
(
'should compile with --include-path option'
,
function
(
done
){
var
emitter
=
cli
([
var
emitter
=
cli
([
'--include-path'
,
__dirname
+
'/lib'
,
'--include-path'
,
path
.
join
(
__dirname
,
'/lib'
)
,
'--include-path'
,
__dirname
+
'/functions'
,
'--include-path'
,
path
.
join
(
__dirname
,
'/functions'
)
,
__dirname
+
'/include_path.scss'
path
.
join
(
__dirname
,
'/include_path.scss'
)
]);
]);
emitter
.
on
(
'error'
,
done
);
emitter
.
on
(
'error'
,
done
);
emitter
.
on
(
'render'
,
function
(
css
){
emitter
.
on
(
'render'
,
function
(
css
){
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment