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
978e11d2
Commit
978e11d2
authored
Apr 09, 2014
by
Damian Janowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleaner detection of bindings with better error handling.
Makes it a clearer when the bindings are found but broken.
parent
fae6f6d4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
16 deletions
+19
-16
sass.js
sass.js
+19
-16
No files found.
sass.js
View file @
978e11d2
var
binding
;
var
fs
=
require
(
'fs'
);
var
path
=
require
(
'path'
);
var
path
=
require
(
'path'
);
var
v8
=
'v8-'
+
/
[
0-9
]
+
\.[
0-9
]
+/
.
exec
(
process
.
versions
.
v8
)[
0
];
function
requireBinding
()
{
var
modPath
=
path
.
join
(
__dirname
,
'bin'
,
process
.
platform
+
'-'
+
process
.
arch
+
'-'
+
v8
,
'binding'
);
var
fs
=
require
(
'fs'
);
try
{
var
v8
=
'v8-'
+
/
[
0-9
]
+
\.[
0-9
]
+/
.
exec
(
process
.
versions
.
v8
)[
0
];
if
(
fs
.
realpathSync
(
__dirname
+
'/build'
))
{
// use the build version if it exists
var
candidates
=
[
binding
=
require
(
__dirname
+
'/build/Release/binding'
);
[
__dirname
,
'build'
,
'Release'
,
'obj.target'
,
'binding.node'
],
}
[
__dirname
,
'bin'
,
process
.
platform
+
'-'
+
process
.
arch
+
'-'
+
v8
,
'binding.node'
],
}
catch
(
e
)
{
];
try
{
fs
.
realpathSync
(
modPath
+
'.node'
);
for
(
var
i
=
0
,
l
=
candidates
.
length
;
i
<
l
;
i
++
)
{
binding
=
require
(
modPath
);
var
candidate
=
path
.
join
.
apply
(
path
.
join
,
candidates
[
i
]);
}
catch
(
ex
)
{
// No binary!
if
(
fs
.
existsSync
(
candidate
))
{
throw
new
Error
(
'`'
+
modPath
+
'.node` is missing. Try reinstalling `node-sass`?'
);
return
require
(
candidate
);
}
}
}
throw
new
Error
(
'`libsass` bindings not found. Try reinstalling `node-sass`?'
);
}
}
var
binding
=
requireBinding
();
var
SASS_OUTPUT_STYLE
=
{
var
SASS_OUTPUT_STYLE
=
{
nested
:
0
,
nested
:
0
,
expanded
:
1
,
expanded
:
1
,
...
...
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