@@ -34,11 +34,11 @@ const redirectToCliRepoError = (e: unknown): never => {
34
34
throw e ;
35
35
} ;
36
36
37
- interface ShadowRepoOptions {
37
+ type ShadowRepoOptions = {
38
38
orgId : string ;
39
39
projectPath : string ;
40
40
packageDirs : NamedPackageDir [ ] ;
41
- }
41
+ } ;
42
42
43
43
// https://isomorphic-git.org/docs/en/statusMatrix#docsNav
44
44
type StatusRow = [ file : string , head : number , workdir : number , stage : number ] ;
@@ -48,12 +48,12 @@ const FILE = 0;
48
48
const HEAD = 1 ;
49
49
const WORKDIR = 2 ;
50
50
51
- interface CommitRequest {
51
+ type CommitRequest = {
52
52
deployedFiles ?: string [ ] ;
53
53
deletedFiles ?: string [ ] ;
54
54
message ?: string ;
55
55
needsUpdatedStatus ?: boolean ;
56
- }
56
+ } ;
57
57
58
58
export class ShadowRepo {
59
59
private static instanceMap = new Map < string , ShadowRepo > ( ) ;
@@ -256,16 +256,13 @@ export class ShadowRepo {
256
256
deployedFiles : deployedFiles . length ,
257
257
deletedFiles : deletedFiles . length ,
258
258
} ) ;
259
- // these are stored in posix/style/path format. We have to convert inbound stuff from windows
260
- if ( this . isWindows ) {
261
- this . logger . trace ( 'start: transforming windows paths to posix' ) ;
262
- deployedFiles = deployedFiles . map ( normalize ) . map ( ensurePosix ) ;
263
- deletedFiles = deletedFiles . map ( normalize ) . map ( ensurePosix ) ;
264
- this . logger . trace ( 'done: transforming windows paths to posix' ) ;
265
- }
266
259
267
260
if ( deployedFiles . length ) {
268
- const chunks = chunkArray ( [ ...new Set ( deployedFiles ) ] , this . maxFileAdd ) ;
261
+ const chunks = chunkArray (
262
+ // these are stored in posix/style/path format. We have to convert inbound stuff from windows
263
+ [ ...new Set ( this . isWindows ? deployedFiles . map ( normalize ) . map ( ensurePosix ) : deployedFiles ) ] ,
264
+ this . maxFileAdd
265
+ ) ;
269
266
for ( const chunk of chunks ) {
270
267
try {
271
268
this . logger . debug ( `adding ${ chunk . length } files of ${ deployedFiles . length } deployedFiles to git` ) ;
@@ -297,7 +294,7 @@ export class ShadowRepo {
297
294
}
298
295
}
299
296
300
- for ( const filepath of [ ...new Set ( deletedFiles ) ] ) {
297
+ for ( const filepath of [ ...new Set ( this . isWindows ? deletedFiles . map ( normalize ) . map ( ensurePosix ) : deletedFiles ) ] ) {
301
298
try {
302
299
// these need to be done sequentially because isogit manages file locking. Isogit remove does not support multiple files at once
303
300
// eslint-disable-next-line no-await-in-loop
0 commit comments