oznaceni polozek v dirtree podle git statusu

This commit is contained in:
2020-12-29 01:53:11 +01:00
parent 9f31a4f171
commit dd73924bbf
3 changed files with 62 additions and 1 deletions

View File

@@ -49,6 +49,30 @@ class Model {
return tree;
}
async getGitStatusTree() {
var dirtree = await this.getDirTree();
var tree = await this.dirGitStatus(dirtree);
return tree;
}
async dirGitStatus(list) {
let dirlist = [list[0]];
for (let i = 1; i < list.length; i++) {
if (Array.isArray(list[i])) {
await this.dirGitStatus(list[i]);
} else {
list[i] = await git.status({
fs,
dir,
filepath: list[0].substring(1) + list[i],
});
}
}
return list;
}
wipeFS() {
delete window.fs;
window.fs = new LightningFS("fs", { wipe: true });