Skip to content

Commit 9784010

Browse files
committed
fix sub directory listing
1 parent f13f307 commit 9784010

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/requests.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@ export async function getContents(
8888

8989
fileList[fileName] = fileList[fileName] ?? {
9090
name: fileName,
91-
path: driveName + '/' + row.path,
91+
path: options.path
92+
? PathExt.join(driveName, options.path, fileName)
93+
: PathExt.join(driveName, fileName),
9294
last_modified: row.last_modified,
9395
created: '',
9496
content: !fileName.split('.')[1] ? [] : null,
@@ -102,8 +104,8 @@ export async function getContents(
102104
});
103105

104106
data = {
105-
name: options.path ? PathExt.basename(options.path) : '',
106-
path: options.path ? options.path + '/' : '',
107+
name: options.path ? PathExt.basename(options.path) : driveName,
108+
path: PathExt.join(driveName, options.path ? options.path + '/' : ''),
107109
last_modified: '',
108110
created: '',
109111
content: Object.values(fileList),
@@ -123,7 +125,7 @@ export async function getContents(
123125

124126
data = {
125127
name: PathExt.basename(options.path),
126-
path: driveName + '/' + response.data.path,
128+
path: PathExt.join(driveName, response.data.path),
127129
last_modified: response.data.last_modified,
128130
created: '',
129131
content: response.data.content,

0 commit comments

Comments
 (0)