aboutsummaryrefslogtreecommitdiff
path: root/includes/fetcher/index.js
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2022-05-06 09:00:04 +0200
committerMinteck <contact@minteck.org>2022-05-06 09:00:04 +0200
commite5e876a3601182c7364544c12ea0aae08c5603c5 (patch)
tree7bfd864cad39cf3e7c2667d574d26c421b9ed9e5 /includes/fetcher/index.js
parentb83d267d0614380981452039626879021c2a4d68 (diff)
downloadember-e5e876a3601182c7364544c12ea0aae08c5603c5.tar.gz
ember-e5e876a3601182c7364544c12ea0aae08c5603c5.tar.bz2
ember-e5e876a3601182c7364544c12ea0aae08c5603c5.zip
Fix bug with GitHub publisher
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