MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / rmDir

Function rmDir

javascript/selenium-webdriver/io/index.js:52–63  ·  view source on GitHub ↗

* Recursively removes a directory and all of its contents. This is equivalent * to rm -rf on a POSIX system. * @param {string} dirPath Path to the directory to remove. * @return {!Promise} A promise to be resolved when the operation has * completed.

(dirPath)

Source from the content-addressed store, hash-verified

50 * completed.
51 */
52function rmDir(dirPath) {
53 return new Promise(function (fulfill, reject) {
54 fs.rm(dirPath, { recursive: true, maxRetries: 2 }, function (err) {
55 if (err && err.code === 'ENOENT') {
56 fulfill()
57 } else if (err) {
58 reject(err)
59 }
60 fulfill()
61 })
62 })
63}
64
65/**
66 * Copies one file to another.

Callers

nothing calls this directly

Calls 1

rejectFunction · 0.85

Tested by

no test coverage detected