aboutsummaryrefslogtreecommitdiff
path: root/includes/fetcher
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2022-04-23 14:45:39 +0200
committerMinteck <contact@minteck.org>2022-04-23 14:45:39 +0200
commit7cb3e566a4a4c551340ab20abce5a846013c3724 (patch)
treec73a7093bd80ffb2eb8c081cd10233e97fd19a58 /includes/fetcher
parent8561db10dbf93f0aacdf0c34921e46dae7884e5b (diff)
downloadember-7cb3e566a4a4c551340ab20abce5a846013c3724.tar.gz
ember-7cb3e566a4a4c551340ab20abce5a846013c3724.tar.bz2
ember-7cb3e566a4a4c551340ab20abce5a846013c3724.zip
Make the GitHub update thingy not error
Diffstat (limited to 'includes/fetcher')
-rw-r--r--includes/fetcher/index.js38
1 files changed, 21 insertions, 17 deletions
diff --git a/includes/fetcher/index.js b/includes/fetcher/index.js
index 43357c8..631a5e1 100644
--- a/includes/fetcher/index.js
+++ b/includes/fetcher/index.js
@@ -223,24 +223,28 @@
}
}).filter(i => i !== null), null, 4));
- if (fs.existsSync("personal")) fs.rmSync("personal", { recursive: true })
- console.log("Cloning minteck/minteck from GitHub...");
- cp.execSync("git clone https://github.com/minteck/minteck personal");
- let list = [];
- for (let project of require('./projects.json')) {
- if (!project.archive) {
- list.push(project.name + " | [" + project.path + "](https://gitlab.minteck.org/" + project.path + ")");
+ try {
+ if (fs.existsSync("personal")) fs.rmSync("personal", { recursive: true })
+ console.log("Cloning minteck/minteck from GitHub...");
+ cp.execSync("git clone https://github.com/minteck/minteck personal");
+ let list = [];
+ for (let project of require('./projects.json')) {
+ if (!project.archive) {
+ list.push(project.name + " | [" + project.path + "](https://gitlab.minteck.org/" + project.path + ")");
+ }
}
- }
- for (let project of require('./projects.json')) {
- if (project.archive) {
- list.push("*" + project.name + "* | *[" + project.path + "](https://gitlab.minteck.org/" + project.path + ")*");
+ for (let project of require('./projects.json')) {
+ if (project.archive) {
+ list.push("*" + project.name + "* | *[" + project.path + "](https://gitlab.minteck.org/" + project.path + ")*");
+ }
}
+ 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")));
+ 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);
}
- 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")));
- 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" });
})() \ No newline at end of file