-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cli): List files to be published
- Loading branch information
James Womack
committed
May 13, 2016
1 parent
86ba947
commit c509791
Showing
5 changed files
with
63 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
function ls (onEnd) { | ||
const FN = require('fstream-npm') | ||
const color = require('chalk') | ||
const glob = require('glob') | ||
const exclude = require('lodash.difference') | ||
|
||
const included = [ ] | ||
|
||
const all = glob.sync('**/**', { ignore : [ 'node_modules/**/**' ], nodir : true }) | ||
|
||
FN({ path: process.cwd() }) | ||
.on('child', function (e) { | ||
included.push(e._path.replace(e.root.path + '/', '')) | ||
}) | ||
.on('end', function () { | ||
const excluded = exclude(all, included) | ||
|
||
console.info(color.magenta('\n\nWILL BE PUBLISHED\n')) | ||
console.info(color.green(included.join('\n'))) | ||
console.info(color.magenta('\n\nWON\'T BE PUBLISHED\n')) | ||
console.info(color.red(excluded.join('\n'))) | ||
|
||
if (typeof onEnd === 'function') { | ||
onEnd({ | ||
included : included, | ||
excluded : excluded | ||
}) | ||
} | ||
}) | ||
} | ||
|
||
module.exports = ls | ||
|
||
if (!module.parent) { | ||
ls() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters