Created
August 15, 2012 03:17
-
-
Save watilde/3355387 to your computer and use it in GitHub Desktop.
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
var dotfiles = (function (){ | |
var cmd = function cmd(hyphenE){ | |
var proto = 'ls -a ./ | grep -v'; | |
for(var i=0; i<hyphenE.length; i++){ | |
proto += ' -e '+hyphenE[i]; | |
} | |
return proto; | |
}; | |
var plastic = function plastic(stdout) { | |
stdout = stdout.split('\n'); | |
stdout = stdout.splice(0, stdout.length-1); | |
return stdout; | |
} | |
var exec = require('child_process').exec | |
, child | |
, grepList = ['"^\.$"','"^\.\.$"', '.git', 'setup.js']; | |
return child = exec(cmd(grepList),function(err, stdout, stderr){ | |
if(!err){ | |
stdout = plastic(stdout); | |
return stdout; | |
}else{ | |
console.log('exec error: ' + err); | |
} | |
}); | |
})(); | |
console.log("dotfiles: " + dotfiles); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment