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
3557024e
Commit
3557024e
authored
Nov 15, 2014
by
Adeel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Install: Fixes error handling.
parent
118d768f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
install.js
scripts/install.js
+3
-2
No files found.
scripts/install.js
View file @
3557024e
...
@@ -20,11 +20,12 @@ function download(url, dest, cb) {
...
@@ -20,11 +20,12 @@ function download(url, dest, cb) {
};
};
var
returnError
=
function
(
err
)
{
var
returnError
=
function
(
err
)
{
fs
.
unlink
(
dest
);
fs
.
unlink
(
dest
);
cb
(
err
);
cb
(
typeof
err
.
message
===
'string'
?
err
.
message
:
err
);
};
};
var
req
=
request
.
get
(
url
,
options
).
on
(
'response'
,
function
(
response
)
{
var
req
=
request
.
get
(
url
,
options
).
on
(
'response'
,
function
(
response
)
{
if
(
response
.
statusCode
<
200
||
response
.
statusCode
>=
300
)
{
if
(
response
.
statusCode
<
200
||
response
.
statusCode
>=
300
)
{
returnError
(
'Can not download file from '
+
url
);
returnError
(
'Can not download file from '
+
url
);
return
;
}
}
response
.
pipe
(
file
);
response
.
pipe
(
file
);
...
@@ -79,7 +80,7 @@ function fetch(name) {
...
@@ -79,7 +80,7 @@ function fetch(name) {
download
(
url
,
dest
,
function
(
err
)
{
download
(
url
,
dest
,
function
(
err
)
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
err
.
message
);
console
.
error
(
err
);
return
;
return
;
}
}
...
...
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