From 1d55dc8397c9ae3405c5f4d9c4eeadbf59f1c678 Mon Sep 17 00:00:00 2001 From: Maiko Gabriel Kinzel Engelke Date: Thu, 28 Apr 2022 13:29:33 -0300 Subject: [PATCH] Fix service according to tests on Raspberry --- .gitignore | 1 + README.md | 4 ++-- package.json | 3 ++- reddit2discord.service.example | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index b8c0659..edce2f4 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,4 @@ node_modules/ build/ *.service src/flair-colors.js +src/flair-colors.ts diff --git a/README.md b/README.md index dfd922e..bc8d010 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ sudo chmod +x build/index.js Now on the new `reddit2discord.service`, we fill in the necessary data. -Replace `` with the absolute path of your node. You can find it with `which npm`. +Replace `` with the absolute path of your node. You can find it with `which node`. Replace `` with the absolute path of this project. You can find it with `pwd` when inside the project's folder. @@ -67,7 +67,7 @@ If however it mentions a problem with the unit file, then you likely wrote somet Colors and messages are all in code, so if you want to change something, right now, you will have to change the code. If you don't mind the way messages are made, just changing the colors is easy. -In `src/flair-colors.ts`, there are 2 arrays, one of flairs, and another of colors. If you don't know programming, just keep in mind how it's done, and don't forget the commas <,>. +In `src/flair-colors.ts`, there are 2 arrays, one of flairs, and another of colors. If you don't know programming, just keep in mind how it's formatted, and don't forget the commas <,>. The array of colors is done with integer numbers instead of the usual Hexcode, or RGB values. I see no common sense in how that works right now, so to find new colors, well, good luck. diff --git a/package.json b/package.json index 9eb02cd..73bffde 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,8 @@ "description": "A minibot to post new posts from a subreddit to discord, ran from a raspberry pi", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", - "startBuild": "tsc && node build/index.js", + "build": "tsc", + "startBuild": "node build/index.js", "start": "ts-node src/index.ts", "dev": "nodemon src/index.ts" }, diff --git a/reddit2discord.service.example b/reddit2discord.service.example index e791e1d..f713bd1 100644 --- a/reddit2discord.service.example +++ b/reddit2discord.service.example @@ -2,7 +2,7 @@ Description=Reddit2Discord [Service] -ExecStart= startBuild +ExecStart= build/index.js Restart=always User=nobody # Note Debian/Ubuntu uses 'nogroup', RHEL/Fedora uses 'nobody'