scripts: move scripts to the project root directory

I believe, that these kind of scripts should reside there
instead of src directory
This commit is contained in:
Wroclaw 2023-09-30 12:31:25 +02:00
parent b7f6a5fe91
commit 6a31473d22
4 changed files with 7 additions and 5 deletions

View file

@ -12,6 +12,7 @@ RUN npx prisma generate
# Typescript compiling
COPY tsconfig.json .
COPY src ./src
COPY scripts ./scripts
RUN npx tsc
# Run the app

View file

@ -6,7 +6,7 @@
"scripts": {
"start": "tsc && node dist/src/index.js",
"test": "echo \"Error: no test specified\" && exit 1",
"publishCommands": "tsc && node dist/src/scripts/pushCommands.js"
"publishCommands": "tsc && node dist/scripts/pushCommands.js"
},
"author": "Wroclaw",
"license": "MIT",

View file

@ -1,15 +1,15 @@
// https://discordjs.guide/creating-your-bot/command-deployment.html#guild-commands
import { REST, RESTGetAPIOAuth2CurrentApplicationResult, RESTPostAPIApplicationCommandsJSONBody, Routes } from "discord.js";
import { config } from "../index";
import { config } from "../src/index";
import requireDirectory from "require-directory";
import Command from "../command";
import Command from "../src/command";
const post: RESTPostAPIApplicationCommandsJSONBody[] = [];
const guildId = process.argv.slice(2)[0];
requireDirectory<{default: Command}, void>(module, "../commands", {
requireDirectory<{default: Command}, void>(module, "../src/commands", {
visit: function (obj) {
console.log(obj);
// eslint-disable-next-line @typescript-eslint/ban-ts-comment

View file

@ -1,6 +1,7 @@
{
"include": [
"./src/**/*"
"./src/**/*",
"./scripts/**/*"
],
"compilerOptions": {
"target": "ES2022",