File tree Expand file tree Collapse file tree 5 files changed +29
-12
lines changed Expand file tree Collapse file tree 5 files changed +29
-12
lines changed Original file line number Diff line number Diff line change 11let path = require ( "path" ) ;
22let { readdir, stat } = require ( "./promisified-fs" ) ;
33
4- function tree ( directory , relativeTo = directory ) {
5- return readdir ( directory ) . then ( entries => {
6- return Promise . all ( entries . map ( entry => {
7- let fullEntry = path . join ( directory , entry ) ;
8-
9- return stat ( fullEntry ) . then ( results => {
10- if ( results . isDirectory ( ) ) {
11- return tree ( fullEntry , relativeTo ) ;
12- } else {
13- return path . relative ( relativeTo , fullEntry ) ;
14- }
4+ function tree ( target , relativeTo = target ) {
5+ return stat ( target ) . then ( results => {
6+ if ( results . isDirectory ( ) ) {
7+ return readdir ( target ) . then ( entries => {
8+ return Promise . all ( entries . map ( entry => {
9+ return tree ( path . join ( target , entry ) , relativeTo ) ;
10+ } ) ) . then ( flatten ) ;
1511 } ) ;
16- } ) ) . then ( flatten ) ;
12+ } else {
13+ return [ path . relative ( relativeTo , target ) ] ;
14+ }
1715 } ) ;
1816}
1917
Original file line number Diff line number Diff line change @@ -69,3 +69,9 @@ begin "./test_manifest_base_uri"
6969 faucet
7070 assert_identical " ./dist/manifest.json" " ./expected.json"
7171end
72+
73+ begin " ./test_single"
74+ faucet --no-fingerprint
75+ assert_identical " ./dist/dist.txt" " ./src.txt"
76+ end
77+
Original file line number Diff line number Diff line change 1+ A more creative text
Original file line number Diff line number Diff line change 1+ "use strict" ;
2+
3+ module . exports = {
4+ static : {
5+ manifest : false ,
6+ bundles : [ {
7+ source : "src.txt" ,
8+ target : "dist/dist.txt"
9+ } ]
10+ }
11+ } ;
Original file line number Diff line number Diff line change 1+ A more creative text
You can’t perform that action at this time.
0 commit comments