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
dfa8c29a
Commit
dfa8c29a
authored
Apr 20, 2015
by
xzyfer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle build script git operations in JS
parent
9cadba9b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
14 deletions
+32
-14
build.js
scripts/build.js
+32
-9
git.sh
scripts/git.sh
+0
-5
No files found.
scripts/build.js
View file @
dfa8c29a
...
@@ -47,24 +47,47 @@ function afterBuild(options) {
...
@@ -47,24 +47,47 @@ function afterBuild(options) {
}
}
/**
/**
*
initSubmodule
s
*
manageProces
s
*
*
* @param {ChildProcess} proc
* @param {Function} cb
* @param {Function} cb
* @api private
* @api private
*/
*/
function
initSubmodules
(
cb
)
{
function
manageProcess
(
proc
,
cb
)
{
var
errorMsg
=
''
;
var
errorMsg
=
''
;
var
git
=
spawn
([
'LIBSASS_GIT_VERSION='
,
pkg
.
libsass
,
' ./scripts/git.sh'
].
join
(
''
));
proc
.
stderr
.
on
(
'data'
,
function
(
data
)
{
git
.
stderr
.
on
(
'data'
,
function
(
data
)
{
errorMsg
+=
data
.
toString
();
errorMsg
+=
data
.
toString
();
});
});
git
.
on
(
'close'
,
function
(
code
)
{
proc
.
on
(
'close'
,
function
(
code
)
{
var
error
;
cb
(
code
===
0
?
null
:
{
message
:
errorMsg
});
if
(
code
!==
0
)
{
});
error
=
{
message
:
errorMsg
+
'Unable to checkout the libSass submodule'
};
}
/**
* initSubmodules
*
* @param {Function} cb
* @api private
*/
function
initSubmodules
(
cb
)
{
console
.
log
(
'Detected a git install'
);
console
.
log
(
'Cloning libSass into src/libsass'
);
var
clone
=
spawn
(
'git'
,
[
'clone'
,
'git@github.com:sass/libsass.git'
,
'./src/libsass'
]);
manageProcess
(
clone
,
function
(
err
)
{
if
(
err
)
{
cb
(
err
);
return
;
}
}
cb
(
error
);
console
.
log
(
'Checking out libsass to '
+
pkg
.
libsass
);
var
checkout
=
spawn
(
'git'
,
[
'checkout'
,
pkg
.
libsass
],
{
cwd
:
'./src/libsass'
});
manageProcess
(
checkout
,
function
(
err
)
{
cb
(
err
);
});
});
});
}
}
...
...
scripts/git.sh
deleted
100755 → 0
View file @
9cadba9b
#!/bin/sh
git clone
--depth
=
1 git@github.com:sass/libsass.git ./src/libsass
cd
./src/libsass
git checkout
$LIBSASS_GIT_VERSION
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