Determine whether the output path is safe to delete. If the outputPath appears anywhere in the parents of the project root, the build would delete the project directory. In this case return `false`, otherwise return `true`. @private @method canDeleteOutputPath @param {String
(outputPath)
| 81 | @return {Boolean} |
| 82 | */ |
| 83 | canDeleteOutputPath(outputPath) { |
| 84 | let rootPathParents = [this.project.root]; |
| 85 | let dir = path.dirname(this.project.root); |
| 86 | rootPathParents.push(dir); |
| 87 | while (dir !== path.dirname(dir)) { |
| 88 | dir = path.dirname(dir); |
| 89 | rootPathParents.push(dir); |
| 90 | } |
| 91 | return rootPathParents.indexOf(outputPath) === -1; |
| 92 | } |
| 93 | |
| 94 | /** |
| 95 | * @private |
no outgoing calls
no test coverage detected