|
|
@ -77,12 +77,18 @@ class Model {
|
|
|
|
return statList;
|
|
|
|
return statList;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
async getChangedFiles(dirTree, statTree) {
|
|
|
|
async getChangedFiles() {
|
|
|
|
|
|
|
|
this.chFiles = await this.changedFiles(this.dirTree, this.gitDirTreeStat);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return this.chFiles;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async changedFiles(dirTree, statTree) {
|
|
|
|
var changedFiles = [];
|
|
|
|
var changedFiles = [];
|
|
|
|
|
|
|
|
|
|
|
|
for (let i = 1; i < dirTree.length; i++) {
|
|
|
|
for (let i = 1; i < dirTree.length; i++) {
|
|
|
|
if (Array.isArray(dirTree[i])) {
|
|
|
|
if (Array.isArray(dirTree[i])) {
|
|
|
|
var vnorena = await this.getChangedFiles(dirTree[i], statTree[i]);
|
|
|
|
var vnorena = await this.changedFiles(dirTree[i], statTree[i]);
|
|
|
|
if (vnorena.length != 0) {
|
|
|
|
if (vnorena.length != 0) {
|
|
|
|
for (let i = 0; i < vnorena.length; i++) {
|
|
|
|
for (let i = 0; i < vnorena.length; i++) {
|
|
|
|
changedFiles.push(vnorena[i]);
|
|
|
|
changedFiles.push(vnorena[i]);
|
|
|
@ -116,6 +122,8 @@ class Model {
|
|
|
|
delete window.fs;
|
|
|
|
delete window.fs;
|
|
|
|
window.fs = new LightningFS("fs", { wipe: true });
|
|
|
|
window.fs = new LightningFS("fs", { wipe: true });
|
|
|
|
await this.getDirTree();
|
|
|
|
await this.getDirTree();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
localStorage.setItem("pushError", "false")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
async cloneRep() {
|
|
|
|
async cloneRep() {
|
|
|
@ -169,6 +177,32 @@ class Model {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async gitAdd() {
|
|
|
|
|
|
|
|
let filesToAdd = this.chFiles;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (let i = 0; i < filesToAdd.length; i++) {
|
|
|
|
|
|
|
|
console.log(filesToAdd[i])
|
|
|
|
|
|
|
|
await git.add({
|
|
|
|
|
|
|
|
fs,
|
|
|
|
|
|
|
|
dir,
|
|
|
|
|
|
|
|
filepath: filesToAdd[i].substring(1),
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/* for (let i = 1; i < dirTree.length; i++) {
|
|
|
|
|
|
|
|
if (Array.isArray(dirTree[i])) {
|
|
|
|
|
|
|
|
await this.gitAddAll(dirTree[i]);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
await git.add({
|
|
|
|
|
|
|
|
fs,
|
|
|
|
|
|
|
|
dir,
|
|
|
|
|
|
|
|
filepath: dirTree[0].substring(1) + dirTree[i],
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
console.log(dirTree[0].substring(1) + dirTree[i]);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
async gitCommit(msg) {
|
|
|
|
async gitCommit(msg) {
|
|
|
|
await git.commit({
|
|
|
|
await git.commit({
|
|
|
|
fs,
|
|
|
|
fs,
|
|
|
|