Compare commits
No commits in common. "825167af68e75e8647ece8734e93b60014d760f3" and "a6d67b22afd3073c0db11ee44db788b610ec101d" have entirely different histories.
825167af68
...
a6d67b22af
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@push.rocks/smartwebdav",
|
"name": "@push.rocks/smartwebdav",
|
||||||
"version": "1.1.1",
|
"version": "1.1.0",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "A TypeScript library for easy interaction with WebDAV servers, including file and directory management.",
|
"description": "A TypeScript library for easy interaction with WebDAV servers, including file and directory management.",
|
||||||
"main": "dist_ts/index.js",
|
"main": "dist_ts/index.js",
|
||||||
|
@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@push.rocks/smartwebdav',
|
name: '@push.rocks/smartwebdav',
|
||||||
version: '1.1.1',
|
version: '1.1.0',
|
||||||
description: 'A TypeScript library for easy interaction with WebDAV servers, including file and directory management.'
|
description: 'A TypeScript library for easy interaction with WebDAV servers, including file and directory management.'
|
||||||
}
|
}
|
||||||
|
@ -112,15 +112,7 @@ export class WebdavClient {
|
|||||||
await this.wdClient.moveFile(sourcePathArg, targetPathArg);
|
await this.wdClient.moveFile(sourcePathArg, targetPathArg);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async deleteFile(pathArg: string, checkNotDirectory = true) {
|
public async deleteDirectory(pathArg: string) {
|
||||||
const stat = (await this.wdClient.stat(pathArg)) as plugins.webdav.FileStat;
|
|
||||||
if (checkNotDirectory && stat.type === 'directory') {
|
|
||||||
throw new Error(`Cannot delete a directory using deleteFile method. Use deleteDirectory instead.`);
|
|
||||||
}
|
|
||||||
await this.wdClient.deleteFile(pathArg);
|
await this.wdClient.deleteFile(pathArg);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async deleteDirectory(pathArg: string) {
|
|
||||||
await this.deleteFile(pathArg, false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user