From e5e876a3601182c7364544c12ea0aae08c5603c5 Mon Sep 17 00:00:00 2001 From: Minteck Date: Fri, 6 May 2022 09:00:04 +0200 Subject: Fix bug with GitHub publisher --- includes/fetcher/index.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/includes/fetcher/index.js b/includes/fetcher/index.js index 5ffc75e..dc4d911 100644 --- a/includes/fetcher/index.js +++ b/includes/fetcher/index.js @@ -239,12 +239,16 @@ } } console.log("Saving..."); - fs.writeFileSync("./personal/README.md", "\n" + fs.readFileSync("./personal/README.mdt").toString().replace("%GITLABFILLHERE%", list.join("\n"))); + fs.writeFileSync("./personal/README.md", "\n" + fs.readFileSync("./personal/README.mdt").toString().replace("%GITLABFILLHERE%", list.join("\n"))); console.log("Publishing changes to GitHub..."); cp.execSync("git add -A", { cwd: "personal" }); cp.execSync("git commit -m \"Update: " + new Date().toISOString() + "\"", { cwd: "personal" }); cp.execSync("git push origin main", { cwd: "personal" }); } catch (e) { - console.error(e); + if (e.stdout && e.stdout.toString().includes("nothing to commit, working tree clean")) { + console.log("No changes to publish"); + } else { + console.error(e); + } } })() \ No newline at end of file -- cgit