Son aktivite 1 day ago

curiouser's Avatar Winston Hoy bu gisti düzenledi 7 years ago. Düzenlemeye git

1 file changed, 15 insertions

git-rename-ts-files.js(dosya oluşturuldu)

@@ -0,0 +1,15 @@
1 + const glob = require("glob");
2 + const { execSync } = require('child_process');
3 +
4 + console.log('building list of files');
5 +
6 + const opts = { absolute: true };
7 + var files = glob.sync("**/*.ts", opts).concat(glob.sync("**/*.tsx", opts)).filter(f => f.indexOf('node_modules') < 0);
8 +
9 + console.log(`found ${files.length} files`);
10 +
11 + files.forEach(f => {
12 + const newName = f.replace(/\.ts(x)?$/, '.js$1');
13 + console.log(`renaming ${f} to ${newName}`);
14 + execSync(`git mv ${f} ${f.replace(/\.ts(x)?$/, '.js$1')}`);
15 + });
Daha yeni Daha eski