| 242 | } |
| 243 | |
| 244 | function moveFolder(oldPath, newPath, files, opts) { |
| 245 | const { verbose, git: useGit } = opts |
| 246 | if (useGit) { |
| 247 | let cmd = `git mv ${oldPath} ${newPath}` |
| 248 | if (verbose) { |
| 249 | console.log(`git mv command: ${chalk.grey(cmd)}`) |
| 250 | } |
| 251 | execSync(cmd) |
| 252 | |
| 253 | cmd = `git commit -a -m "renamed ${files.length} files"` |
| 254 | if (verbose) { |
| 255 | console.log(`git commit command: ${chalk.grey(cmd)}`) |
| 256 | } |
| 257 | execSync(cmd) |
| 258 | } else { |
| 259 | fs.renameSync(oldPath, newPath) |
| 260 | if (verbose) { |
| 261 | console.log(`Renamed folder ${chalk.bold(oldPath)} to ${chalk.bold(newPath)}`) |
| 262 | } |
| 263 | } |
| 264 | } |
| 265 | |
| 266 | function undoFolder(oldPath, newPath, files, opts) { |
| 267 | const { verbose, git: useGit } = opts |