(folderPath: string)
| 322 | } |
| 323 | |
| 324 | fixPermissions(folderPath: string): FileSystem { |
| 325 | console.log('Fixing Permissions: ' + folderPath) |
| 326 | |
| 327 | const excludedPaths = [ |
| 328 | '.git', |
| 329 | 'vendor', |
| 330 | 'node_modules', |
| 331 | ] |
| 332 | |
| 333 | if(excludedPaths.some(p => folderPath.includes(p))) { |
| 334 | return this |
| 335 | } |
| 336 | |
| 337 | fs.chmodSync(folderPath, 0o755) |
| 338 | |
| 339 | fs.readdirSync(folderPath).forEach((file) => { |
| 340 | const curPath = path.join(folderPath, file) |
| 341 | |
| 342 | if (fs.lstatSync(curPath).isDirectory()) { |
| 343 | this.fixPermissions(curPath) |
| 344 | } else { |
| 345 | fs.chmodSync(curPath, 0o644) |
| 346 | } |
| 347 | }) |
| 348 | |
| 349 | return this |
| 350 | } |
| 351 | |
| 352 | } |
| 353 |
no test coverage detected