Created
December 17, 2021 07:15
-
-
Save upupming/8ca5fb50f2fc2ec62c13b6add27ec56e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs') | |
const path = require('path') | |
const move = (a, b) => { | |
console.log(`moving from ${a} to ${b}`) | |
// return | |
fs.renameSync(a, b) | |
} | |
const folder = 'LiTS' | |
fs.readdirSync(folder).forEach(file => { | |
console.log(file) | |
const fullPath = path.resolve(folder, file) | |
move(fullPath, fullPath.slice(0, -4)) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment