File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -385,6 +385,9 @@ export class S3Service {
385385 } ;
386386
387387 public async getFiles ( prefix : string ) : Promise < string [ ] > {
388+ if ( prefix . startsWith ( '/' ) ) {
389+ prefix = prefix . slice ( 1 ) ;
390+ }
388391 const objectNames : string [ ] = [ ] ;
389392 const stream = this . client . listObjectsV2 ( this . config . bucket , prefix , true ) ;
390393
@@ -431,7 +434,9 @@ export class S3Service {
431434
432435 public async moveFiles ( srcPath : string , distPath : string ) : Promise < void > {
433436 try {
434- // Normalize paths to ensure they end with '/'
437+ if ( srcPath . startsWith ( '/' ) ) {
438+ srcPath = srcPath . slice ( 1 ) ;
439+ }
435440 const normalizedSrcPath = srcPath . endsWith ( '/' ) ? srcPath : `${ srcPath } /` ;
436441 const normalizedDistPath = distPath . endsWith ( '/' ) ? distPath : `${ distPath } /` ;
437442
You can’t perform that action at this time.
0 commit comments