Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
yy4382 committed May 15, 2024
1 parent 24fdeb7 commit d47c500
Showing 1 changed file with 18 additions and 19 deletions.
37 changes: 18 additions & 19 deletions src/Upload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,31 +132,30 @@ export default class Uploader {
}

private async fs_upload(posts: Post[]): Promise<void> {
if (!Platform.isIosApp) return;
const fs = new FS(Uploader.indexedDBName);
const config = this.settings.uploader.git;
const dir = "/posts";

// enum RepoStat {
// NOT_EXIST,
// NOT_UP_TO_DATE,
// UP_TO_DATE,
// }
enum RepoStat {
NOT_EXIST,
NOT_UP_TO_DATE,
UP_TO_DATE,
}

// let repoStat: RepoStat | undefined = undefined;
let repoStat: RepoStat | undefined = undefined;

// new Notice("Start uploading to git, try using locally cached repo...");
// // Check if the repo is already cloned and up to date
// let localSha = "";
// try {
// localSha = await git.resolveRef({
// fs,
// dir: dir,
// ref: "refs/heads/" + config.branch,
// });
// } catch (e) {
// repoStat = RepoStat.NOT_EXIST;
// }
new Notice("Start uploading to git, try using locally cached repo...");
// Check if the repo is already cloned and up to date
let localSha = "";
try {
localSha = await git.resolveRef({
fs,
dir: dir,
ref: "refs/heads/" + config.branch,
});
} catch (e) {
repoStat = RepoStat.NOT_EXIST;
}

// if (repoStat === undefined) {
// // repo already exists. Check if the remote is up to date
Expand Down

0 comments on commit d47c500

Please sign in to comment.