Skip to content

Commit 7a1e9e6

Browse files
committed
fix: don't modify key names
1 parent 0f19cc8 commit 7a1e9e6

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/git.ts

+4-6
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import * as serializer from './serializer'
55
import {SyncPromise} from './sync-promise'
66
import {PG_Vars} from './pg-types'
77
import {setupMemfs} from './fs'
8-
import {plog} from './pg-log'
98

109
function writeGitFiles(gitFiles: any, fs: memfs.IFs) {
1110
Object.keys(gitFiles).map(filepath => {
@@ -36,12 +35,11 @@ export const rowToRepo = ({OLD, NEW, ...pg}: PG_Vars) => {
3635
.then(setupGitFolder)
3736
.then(() => {
3837
if (!NEW) return
39-
Object.keys(NEW)
40-
.filter(k => k !== repoColumn)
41-
.forEach((k, i) => {
42-
const val = NEW[k]
38+
Object.entries(NEW)
39+
.filter(([k]) => k !== repoColumn)
40+
.forEach(([k, val]) => {
4341
const content = serializer.stringify(val)
44-
const filepath = `${repo.dir}/${k.replace(/\W/g, '_')}`
42+
const filepath = `${repo.dir}/${k}`
4543
fs.writeFileSync(filepath, content, {encoding: 'utf8'})
4644
})
4745
return SyncPromise.resolve()

0 commit comments

Comments
 (0)