From ac3ddab720a392e43afb0879b173b7456b3874af Mon Sep 17 00:00:00 2001 From: Volpeon Date: Sun, 17 Oct 2021 18:16:13 +0200 Subject: Detect if Mastodon token is not set --- package.json | 3 +++ src/index.ts | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/package.json b/package.json index 01dabf4..a88dbf9 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,9 @@ "author": "Volpeon", "license": "MIT", "private": true, + "scripts": { + "start": "node -r ts-node/register src/index.ts" + }, "dependencies": { "@types/sharp": "^0.29.2", "file-type": "^16.5.3", diff --git a/src/index.ts b/src/index.ts index 7185e23..42081e6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -3,6 +3,11 @@ import * as mastodon from "./api/mastodon"; import config from "./config"; (async () => { + if (!config.mastodon.token) { + console.error("MASTODON_TOKEN not set"); + return; + } + console.log("Fetching post..."); const post = await e621.randomPost(); -- cgit v1.2.3-70-g09d2