aboutsummaryrefslogtreecommitdiff
path: root/includes/fetcher/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'includes/fetcher/index.js')
-rw-r--r--includes/fetcher/index.js8
1 files 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", "<!-- WARNING: Do not modify this file, modify README.mdt instead. This file will get overwritten whenever the project fetcher runs. -->\n" + fs.readFileSync("./personal/README.mdt").toString().replace("%GITLABFILLHERE%", list.join("\n")));
+ fs.writeFileSync("./personal/README.md", "<!-- WARNING: Do not modify this file, modify README.mdt instead. This file will get overwritten whenever the project fetcher runs. Publish date: " + new Date().toISOString() + " -->\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