update_main_branch = {
if (!commit) throw "skipped";
try {
await filesystem.lstat(dir);
await git.checkout({
fs: filesystem,
filesystem,
http,
dir,
corsProxy: "https://cors.isomorphic-git.org",
url: target_git,
ref: "main",
singleBranch: true,
depth: 1,
author: {
name: "Jumpgate",
email: "jumpgate@lopecode.com"
}
});
return git.pull({
fs: filesystem,
filesystem,
http,
dir,
corsProxy: "https://cors.isomorphic-git.org",
url: target_git,
ref: "main",
singleBranch: true,
depth: 1,
author: {
name: "Jumpgate",
email: "jumpgate@lopecode.com"
}
});
} catch (err) {
return git.clone({
fs: filesystem,
filesystem,
http,
dir,
corsProxy: "https://cors.isomorphic-git.org",
url: target_git,
ref: "main",
singleBranch: true,
depth: 1
});
}
}