Created
January 22, 2016 00:50
-
-
Save dantheman213/112499c7a413814e5c5e to your computer and use it in GitHub Desktop.
This script will allow you to prune large collections of files by removing duplicates, fixing filename syntax, and organize better
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
#!/usr/bin/env node | |
// required packages | |
// npm install walk | |
// libraries | |
var walk = require('walk'); | |
// globals | |
var args = process.argv.splice(2); | |
var files = []; | |
console.log(args); | |
process.exit(0); | |
var walker = walk.walk('./test', { followLinks: false }); | |
walker.on('file', function(root, stat, next) { | |
// Add this file to the list of files | |
files.push(root + '/' + stat.name); | |
next(); | |
}); | |
walker.on('end', function() { | |
console.log(files); | |
// TBD | |
console.log('complete.'); | |
process.exit(0); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment