Skip to content

Commit 7803a94

Browse files
committed
add logging
1 parent 8f1fd5d commit 7803a94

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,5 @@ lib/
5959

6060
# Redis Dump
6161
dump.rdb
62+
/tmp-ts/src
63+
/types

resources/flow-to-ts.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ const files = glob.sync("src/**/*.js", {
1111
});
1212

1313
files.forEach(file => {
14-
console.log(`Processing: ${file}`)
14+
const outFile = `./tmp-ts/${file.replace('.js', '.ts')}`
15+
const outPath = path.dirname(outFile)
16+
17+
console.log(`Processing: ${file} -> ${outFile}`)
1518

1619
const flowCode = fs.readFileSync(file, "utf-8");
1720

@@ -34,11 +37,10 @@ files.forEach(file => {
3437
prettier: true,
3538
})
3639

37-
const outFile = `./tmp-ts/${file.replace('.js', '.ts')}`
38-
const outPath = path.dirname(outFile)
40+
3941
if(!fs.existsSync(outPath)){
4042
fs.mkdirSync(outPath , {recursive:true})
4143
}
4244

43-
fs.writeFileSync(outFile, typescriptCode, (err) => {})
45+
fs.writeFileSync(outFile, typescriptCode)
4446
});

0 commit comments

Comments
 (0)