Skip to content

Instantly share code, notes, and snippets.

@pissang
Last active January 13, 2020 07:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pissang/1fcc7b1122b4cbd03d6862b5d4fdfdff to your computer and use it in GitHub Desktop.
Save pissang/1fcc7b1122b4cbd03d6862b5d4fdfdff to your computer and use it in GitHub Desktop.
const glob = require('glob');
const child_process = require('child_process');
const util = require('util');
const exec = util.promisify(child_process.exec);
glob('src/**/*.js', async (err, files) => {
console.log(files);
for (let file of files) {
await exec(`git mv ${file} ${file.replace('.js', '.ts')}`);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment