This commit is contained in:
parent
6a3fb6d693
commit
84340887bb
|
@ -61,6 +61,12 @@ The web server will be running at `http://localhost:8000` and the email server a
|
||||||
$ npx pm2 deploy package.json production setup
|
$ npx pm2 deploy package.json production setup
|
||||||
```
|
```
|
||||||
|
|
||||||
5. Migrate the existing feeds.
|
5. Migrate the existing feeds:
|
||||||
|
|
||||||
|
```console
|
||||||
|
$ ssh-add
|
||||||
|
$ ssh -A root@kill-the-newsletter.com
|
||||||
|
root@kill-the-newsletter.com $ rsync -av <path-to-previous-feeds> /root/www.kill-the-newsletter.com/current/static/feeds/
|
||||||
|
```
|
||||||
|
|
||||||
6. Push to GitHub, which will trigger the Action that deploys the code and starts the server.
|
6. Push to GitHub, which will trigger the Action that deploys the code and starts the server.
|
||||||
|
|
|
@ -1,17 +0,0 @@
|
||||||
import xml2js from "xml2js";
|
|
||||||
import fs from "fs";
|
|
||||||
|
|
||||||
(async () => {
|
|
||||||
for (const feed of fs
|
|
||||||
.readdirSync("static/feeds")
|
|
||||||
.filter(file => !file.startsWith(".")))
|
|
||||||
try {
|
|
||||||
const xml = await new xml2js.Parser().parseStringPromise(
|
|
||||||
fs.readFileSync(`static/feeds/${feed}`, "utf8")
|
|
||||||
);
|
|
||||||
if (xml?.feed?.updated === undefined)
|
|
||||||
throw new Error("Can’t find xml.feed.updated");
|
|
||||||
} catch (error) {
|
|
||||||
console.error(`Error for ${feed}: ${error}`);
|
|
||||||
}
|
|
||||||
})();
|
|
Loading…
Reference in New Issue