Skip to content

Commit

Permalink
Fix: S3 connection does not work correctly in Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
ollm authored Apr 3, 2024
1 parent 870ecaf commit 9352e3a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scripts/server-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -1263,7 +1263,7 @@ var client = function(path) {

let s3 = await this.connectS3();

let base = getPathWithoutShare(path);
let base = posixPath(getPathWithoutShare(path));
let nextContinuationToken = false;

for(let page = 0; page < 10; page++) // Get max 10000 files
Expand All @@ -1284,7 +1284,7 @@ var client = function(path) {
for(let i = 0, len = entries.Contents.length; i < len; i++)
{
let entry = entries.Contents[i];
let name = fileManager.removePathPart(entry.Key, base).replace(/\/$/, '');
let name = fileManager.removePathPart(entry.Key, base).replace(/\/$/, '').replace(/^\//, '');

let folder = /\/$/.test(entry.Key);

Expand All @@ -1301,7 +1301,7 @@ var client = function(path) {
for(let i = 0, len = entries.CommonPrefixes.length; i < len; i++)
{
let entry = entries.CommonPrefixes[i];
let name = fileManager.removePathPart(entry.Prefix, base).replace(/\/$/, '');
let name = fileManager.removePathPart(entry.Prefix, base).replace(/\/$/, '').replace(/^\//, '');

if(name && !/\/./.test(name))
{
Expand Down Expand Up @@ -1370,7 +1370,7 @@ var client = function(path) {

let params = {
Bucket: s3.bucket,
Key: getPathWithoutShare(path),
Key: posixPath(getPathWithoutShare(path)),
};

let response = await s3.client.send(new s3c.Get(params));
Expand Down

0 comments on commit 9352e3a

Please sign in to comment.