You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-06-21 23:17:42 +02:00
All: Add mechanism to lock and upgrade sync targets (#3524)
This commit is contained in:
@ -78,6 +78,10 @@ class FileApiDriverOneDrive {
|
||||
}
|
||||
|
||||
async list(path, options = null) {
|
||||
options = Object.assign({}, {
|
||||
context: null,
|
||||
}, options);
|
||||
|
||||
let query = this.itemFilter_();
|
||||
let url = `${this.makePath_(path)}:/children`;
|
||||
|
||||
@ -186,8 +190,23 @@ class FileApiDriverOneDrive {
|
||||
return this.pathCache_[path];
|
||||
}
|
||||
|
||||
clearRoot() {
|
||||
throw new Error('Not implemented');
|
||||
async clearRoot() {
|
||||
const recurseItems = async (path) => {
|
||||
const result = await this.list(this.fileApi_.fullPath_(path));
|
||||
const output = [];
|
||||
|
||||
for (const item of result.items) {
|
||||
const fullPath = `${path}/${item.path}`;
|
||||
if (item.isDir) {
|
||||
await recurseItems(fullPath);
|
||||
}
|
||||
await this.delete(this.fileApi_.fullPath_(fullPath));
|
||||
}
|
||||
|
||||
return output;
|
||||
};
|
||||
|
||||
await recurseItems('');
|
||||
}
|
||||
|
||||
async delta(path, options = null) {
|
||||
|
Reference in New Issue
Block a user