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
ce372052
Commit
ce372052
authored
Sep 18, 2015
by
Michael Mifsud
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1126 from dotzero/follow
Add --follow option to the CLI
parents
2b8a9862
41cf00d9
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
1 deletions
+46
-1
README.md
README.md
+1
-0
node-sass
bin/node-sass
+3
-1
cli.js
test/cli.js
+26
-0
index.scss
test/fixtures/follow/foo/bar/index.scss
+16
-0
No files found.
README.md
View file @
ce372052
...
...
@@ -496,6 +496,7 @@ Output will be saved with the same name as input Sass file into the current work
--source-map-embed Embed sourceMappingUrl as data URI
--source-map-root Base path, will be emitted in source-map as is
--include-path Path to look for imported files
--follow Follow symlinked directories
--precision The amount of precision allowed in decimal numbers
--importer Path to .js file containing custom importer
--functions Path to .js file containing custom functions
...
...
bin/node-sass
View file @
ce372052
...
...
@@ -46,6 +46,7 @@ var cli = meow({
' --source-map-embed Embed sourceMappingUrl as data URI'
,
' --source-map-root Base path, will be emitted in source-map as is'
,
' --include-path Path to look for imported files'
,
' --follow Follow symlinked directories'
,
' --precision The amount of precision allowed in decimal numbers'
,
' --importer Path to .js file containing custom importer'
,
' --functions Path to .js file containing custom functions'
,
...
...
@@ -54,6 +55,7 @@ var cli = meow({
},
{
boolean
:
[
'indented-syntax'
,
'follow'
,
'omit-source-map-url'
,
'quiet'
,
'recursive'
,
...
...
@@ -331,7 +333,7 @@ function renderFile(file, options, emitter) {
*/
function
renderDir
(
options
,
emitter
)
{
var
globPath
=
path
.
resolve
(
options
.
directory
,
globPattern
(
options
));
glob
(
globPath
,
{
ignore
:
'**/_*'
},
function
(
err
,
files
)
{
glob
(
globPath
,
{
ignore
:
'**/_*'
,
follow
:
options
.
follow
},
function
(
err
,
files
)
{
if
(
err
)
{
return
emitter
.
emit
(
'error'
,
util
.
format
(
'You do not have permission to access this path: %s.'
,
err
.
path
));
}
else
if
(
!
files
.
length
)
{
...
...
test/cli.js
View file @
ce372052
...
...
@@ -590,6 +590,32 @@ describe('cli', function() {
});
describe
(
'node-sass --follow --output output-dir input-dir'
,
function
()
{
it
(
'should compile with the --follow option'
,
function
(
done
)
{
var
src
=
fixture
(
'follow/input-dir'
);
var
dest
=
fixture
(
'follow/output-dir'
);
fs
.
mkdirSync
(
src
);
fs
.
symlinkSync
(
path
.
join
(
path
.
dirname
(
src
),
'foo'
),
path
.
join
(
src
,
'foo'
),
'dir'
);
var
bin
=
spawn
(
cli
,
[
src
,
'--follow'
,
'--output'
,
dest
]);
bin
.
once
(
'close'
,
function
()
{
var
expected
=
path
.
join
(
dest
,
'foo/bar/index.css'
);
fs
.
unlinkSync
(
path
.
join
(
src
,
'foo'
));
fs
.
rmdirSync
(
src
);
assert
(
fs
.
existsSync
(
expected
));
fs
.
unlinkSync
(
expected
);
expected
=
path
.
dirname
(
expected
);
fs
.
rmdirSync
(
expected
);
expected
=
path
.
dirname
(
expected
);
fs
.
rmdirSync
(
expected
);
fs
.
rmdirSync
(
dest
);
done
();
});
});
});
describe
(
'importer'
,
function
()
{
var
dest
=
fixture
(
'include-files/index.css'
);
var
src
=
fixture
(
'include-files/index.scss'
);
...
...
test/fixtures/follow/foo/bar/index.scss
0 → 100644
View file @
ce372052
#navbar
{
width
:
80%
;
height
:
23px
;
}
#navbar
ul
{
list-style-type
:
none
;
}
#navbar
li
{
float
:
left
;
a
{
font-weight
:
bold
;
}
}
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