@@ -2,7 +2,6 @@ import * as memfs from 'memfs'
2
2
import * as path from 'path'
3
3
import * as git from 'isomorphic-git'
4
4
import * as serializer from './serializer'
5
- import { SyncPromise } from './sync-promise'
6
5
import { PG_Vars } from './pg-types'
7
6
import { setupMemfs } from './fs'
8
7
@@ -31,7 +30,7 @@ export const rowToRepo = ({OLD, NEW, ...pg}: PG_Vars) => {
31
30
32
31
const commitMessage = `${ pg . TG_NAME } : ${ pg . TG_WHEN } ${ pg . TG_OP } ${ pg . TG_LEVEL } on ${ pg . TG_TABLE_SCHEMA } .${ pg . TG_TABLE_NAME } ` . trim ( )
33
32
34
- return SyncPromise . resolve ( )
33
+ return Promise . resolve ( )
35
34
. then ( setupGitFolder )
36
35
. then ( ( ) => {
37
36
if ( ! NEW ) return
@@ -42,7 +41,7 @@ export const rowToRepo = ({OLD, NEW, ...pg}: PG_Vars) => {
42
41
const filepath = `${ repo . dir } /${ k } `
43
42
fs . writeFileSync ( filepath , content , { encoding : 'utf8' } )
44
43
} )
45
- return SyncPromise . resolve ( )
44
+ return Promise . resolve ( )
46
45
. then ( ( ) => git . add ( { ...repo , filepath : '.' } ) )
47
46
. then ( ( ) =>
48
47
git . commit ( {
@@ -52,7 +51,7 @@ export const rowToRepo = ({OLD, NEW, ...pg}: PG_Vars) => {
52
51
} ) ,
53
52
)
54
53
. then ( commit =>
55
- SyncPromise . all (
54
+ Promise . all (
56
55
( NEW ?. git ?. tags || [ ] ) . map ( ( tag : string ) => {
57
56
return git . tag ( { ...repo , ref : tag , object : commit } )
58
57
} ) ,
@@ -88,19 +87,19 @@ export const gitLog = (gitRepoJson: object, depth?: number) => {
88
87
const { fs} = setupMemfs ( )
89
88
const repo = { fs, dir : '/repo' }
90
89
91
- return SyncPromise . resolve ( )
90
+ return Promise . resolve ( )
92
91
. then ( ( ) => writeGitFiles ( gitRepoJson , fs ) )
93
92
. then ( ( ) => git . log ( { ...repo , depth} ) )
94
93
. then ( log => {
95
- return SyncPromise . all (
94
+ return Promise . all (
96
95
log . map ( e => {
97
96
return git
98
97
. walk ( {
99
98
...repo ,
100
99
trees : [ e . oid , e . commit . parent [ 0 ] ] . filter ( Boolean ) . map ( ref => git . TREE ( { ref} ) ) ,
101
100
map : ( filepath , entries ) => {
102
101
const [ Child , Parent ] = entries || [ ]
103
- return SyncPromise . all ( [ resolveTree ( Child ) , Parent && resolveTree ( Parent ) ] ) . then (
102
+ return Promise . all ( [ resolveTree ( Child ) , Parent && resolveTree ( Parent ) ] ) . then (
104
103
( [ ChildInfo , ParentInfo ] ) : WalkResult => ( { filepath, ChildInfo, ParentInfo} as WalkResult ) ,
105
104
)
106
105
} ,
@@ -134,7 +133,7 @@ export const gitResolve = (gitRepoJson: object, ref: string) => {
134
133
const { fs} = setupMemfs ( )
135
134
const repo = { fs, dir : '/repo' }
136
135
137
- return SyncPromise . resolve ( )
136
+ return Promise . resolve ( )
138
137
. then ( ( ) => writeGitFiles ( gitRepoJson , fs ) )
139
138
. then ( ( ) =>
140
139
git . walk ( {
@@ -164,5 +163,5 @@ type ResolvedTree = PromiseResult<ReturnType<typeof resolveTree>>
164
163
/** gets the type, content and oid for a `WalkerEntry` */
165
164
const resolveTree = ( tree : git . WalkerEntry | undefined ) => {
166
165
const promises = tree && [ tree . type ( ) , tree . content ( ) . then ( btos ) , tree . oid ( ) ]
167
- return promises && SyncPromise . all ( promises ) . then ( ( [ type , content , oid ] ) => ( { type, content, oid} ) )
166
+ return promises && Promise . all ( promises ) . then ( ( [ type , content , oid ] ) => ( { type, content, oid} ) )
168
167
}
0 commit comments