Signed-off-by: Sam Therapy <sam@samtherapy.net>
This commit is contained in:
parent
b9e294da14
commit
8fcbc8ee1d
7 changed files with 11 additions and 12 deletions
|
@ -1,8 +1,8 @@
|
|||
import { createReadStream, ReadStream } from "fs";
|
||||
import { readdir } from "fs/promises";
|
||||
import { exit } from "process";
|
||||
import args from "./helpers/cli.js";
|
||||
import crashHandler from "./helpers/error.js";
|
||||
import args from "./helpers/args.js";
|
||||
import crashHandler from "./helpers/crashHandler.js";
|
||||
import { config } from "./helpers/types.js";
|
||||
import postImage from "./postImage.js";
|
||||
|
||||
|
|
|
@ -6,8 +6,8 @@ import got from "got-cjs";
|
|||
import stream from "node:stream";
|
||||
import { promisify } from "node:util";
|
||||
import { exit } from "process";
|
||||
import args from "./helpers/cli.js";
|
||||
import crashHandler from "./helpers/error.js";
|
||||
import args from "./helpers/args.js";
|
||||
import crashHandler from "./helpers/crashHandler.js";
|
||||
import { config } from "./helpers/types.js";
|
||||
import postImage from "./postImage.js";
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { exit } from "process";
|
||||
import args from "./cli.js";
|
||||
import args from "./args.js";
|
||||
|
||||
/**
|
||||
* The function that gets called when the program runs into an error.
|
|
@ -1,7 +1,7 @@
|
|||
import { readFile } from "fs/promises";
|
||||
import stripJsonComments from "strip-json-comments";
|
||||
import args from "./cli.js";
|
||||
import crashHandler from "./error.js";
|
||||
import args from "./args.js";
|
||||
import crashHandler from "./crashHandler.js";
|
||||
import { config } from "./types.js";
|
||||
|
||||
/**
|
||||
|
@ -9,11 +9,10 @@ import { config } from "./types.js";
|
|||
* @returns The config object
|
||||
*/
|
||||
async function readConfig(): Promise<string> {
|
||||
const conf = await readFile(args.config, "utf8").catch((err) => {
|
||||
return readFile(args.config, "utf8").catch((err) => {
|
||||
crashHandler("Error reading config file.", err);
|
||||
return "CRASH";
|
||||
});
|
||||
return conf;
|
||||
}
|
||||
/**
|
||||
* Parses the config file and returns it as a JSON object
|
|
@ -1,4 +1,4 @@
|
|||
import getConfig from "./helpers/config.js";
|
||||
import getConfig from "./helpers/getConfig.js";
|
||||
import { config } from "./helpers/types.js";
|
||||
import getLocalImage from "./getLocalImage.js";
|
||||
import getRemoteImage from "./getRemoteImage.js";
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { ReadStream } from "fs";
|
||||
import generator, { Entity, Response } from "megalodon";
|
||||
import { Readable } from "stream";
|
||||
import args from "./helpers/cli.js";
|
||||
import crashHandler from "./helpers/error.js";
|
||||
import args from "./helpers/args.js";
|
||||
import crashHandler from "./helpers/crashHandler.js";
|
||||
import { config } from "./helpers/types.js";
|
||||
|
||||
/**
|
||||
|
|
Reference in a new issue