(path, suffix, verbose)
| 31 | } |
| 32 | |
| 33 | async function migrate (path, suffix, verbose) { |
| 34 | const files = await readdir(path) |
| 35 | for (const file of files) { |
| 36 | const fullFilePath = Path.join(path, file) |
| 37 | const stat = await lstat(fullFilePath) |
| 38 | if (stat.isFile()) { |
| 39 | if (shouldMigrateFile(file)) { |
| 40 | const newFullFilePath = getNewFileName(fullFilePath, suffix) |
| 41 | if (verbose) { |
| 42 | console.log(`${fullFilePath}\n => ${newFullFilePath}`) |
| 43 | } |
| 44 | await rename(fullFilePath, newFullFilePath) |
| 45 | } |
| 46 | } else { |
| 47 | if (shouldMigrateFolder(file)) { |
| 48 | await migrate(fullFilePath, suffix, verbose) |
| 49 | } |
| 50 | } |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | function getNewFileName (fullFilePath, suffix) { |
| 55 | return fullFilePath + suffix |
no test coverage detected