MCPcopy Index your code
hub / github.com/socketstream/socketstream / removeDirectoryIfExists

Function removeDirectoryIfExists

test/unit/cli/generate.test.js:37–45  ·  view source on GitHub ↗

* Executes a child process to forcefully remove * a directory containing files * * @param {String} dirPath The path of the directory to remove * @param {Function} cb The function to execute when finished * @return {Void}

(dirPath, cb)

Source from the content-addressed store, hash-verified

35 * @return {Void}
36 */
37function removeDirectoryIfExists (dirPath, cb) {
38 fs.exists(dirPath, function(exists){
39 if (exists) {
40 removeForcefully(dirPath, cb);
41 } else {
42 cb();
43 }
44 });
45}
46
47describe('lib/cli/generate', function () {
48

Callers 1

generate.test.jsFile · 0.85

Calls 2

removeForcefullyFunction · 0.85
cbFunction · 0.50

Tested by

no test coverage detected