Skip to content

Instantly share code, notes, and snippets.

@upupming
Created December 17, 2021 07:15
Show Gist options
  • Save upupming/8ca5fb50f2fc2ec62c13b6add27ec56e to your computer and use it in GitHub Desktop.
Save upupming/8ca5fb50f2fc2ec62c13b6add27ec56e to your computer and use it in GitHub Desktop.
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