From 445752ced8c290caafd6aa3d4ac2999a2977b170 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Kr=C3=BChlmann?= Date: Wed, 1 Nov 2023 00:22:22 +0100 Subject: [PATCH] Remove absolute link --- Dockerfile | 1 + README.md | 2 -- docker-compose.yml | 6 ++++++ src/item/storage.ts | 3 ++- 4 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile index bed5319..5975d2a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,6 +3,7 @@ RUN apt update \ && apt-get install -y --no-install-recommends make git \ && npm install --global pnpm WORKDIR /usr/app +COPY data.json . COPY Makefile . COPY package.json . COPY pnpm-lock.yaml . diff --git a/README.md b/README.md index cc02bb7..f9a3dd2 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,6 @@ # Classic DB discord bot [![Discord Server](https://img.shields.io/discord/572880907682447380%20.svg?logo=discord&style=for-the-badge)](https://discord.gg/Y5eA3dW) -[![Build Status](https://img.shields.io/travis/Kruhlmann/classicdb_bot.svg?style=for-the-badge)](https://travis-ci.org/Kruhlmann/classicdb_bot) -[![Maintainability](https://img.shields.io/codeclimate/maintainability/Kruhlmann/classicdb_bot.svg?style=for-the-badge)](https://codeclimate.com/github/Kruhlmann/classicdb_bot/maintainability) [![CII Best Practices](https://img.shields.io/cii/percentage/2579.svg?label=CII%20Best%20Practices&style=for-the-badge)](https://bestpractices.coreinfrastructure.org/projects/2579) ## Setup diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..8adb360 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,6 @@ +version: '3' +services: + classicdb_bot: + image: classicdb_bot + env_file: + - .env diff --git a/src/item/storage.ts b/src/item/storage.ts index 6aff69c..420c231 100644 --- a/src/item/storage.ts +++ b/src/item/storage.ts @@ -1,5 +1,6 @@ import { readFileSync } from "fs"; import { Item } from "./item"; +import * as path from "node:path" let items: Item[] = []; let autocomplete: Record; @@ -7,7 +8,7 @@ let autocomplete: Record; export function get_items(): Item[] { if (items.length === 0) { items = JSON.parse( - readFileSync("/home/ges/doc/src/github.com/kruhlmann/neo_classicdb_bot/data.json").toString(), + readFileSync(path.join(__dirname, '../../data.json')).toString(), ); } return items;