Duplicate content with JS
This file contains 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-extra'); | |
const glob = require('glob'); | |
const promisify = require('util.promisify'); | |
const globAsync = promisify(glob); | |
const getAllFiles = async () => { | |
const allFiles = await globAsync('../content/**/*.de.md'); | |
for (const file of allFiles) { | |
await fs.copy(file, file.replace('.de.md','.test.md')); | |
} | |
} | |
(async () => { | |
await getAllFiles(); | |
})(); |
This file contains 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
{ | |
"name": "duplciate-content", | |
"version": "1.0.0", | |
"main": "index.js", | |
"license": "MIT", | |
"dependencies": { | |
"fs-extra": "^9.0.1", | |
"glob": "^7.1.6" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment