From fe1c65afa1cf534447e90f3928c71db524cc8049 Mon Sep 17 00:00:00 2001 From: Ali Hammoud Date: Mon, 27 Jul 2026 15:51:41 +0300 Subject: [PATCH 1/2] fix: windows path --- src/scripts/deploy-commands.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/scripts/deploy-commands.ts b/src/scripts/deploy-commands.ts index a08e87f..2bd4711 100644 --- a/src/scripts/deploy-commands.ts +++ b/src/scripts/deploy-commands.ts @@ -5,16 +5,13 @@ import { } from 'discord.js'; import { commands } from '@/common/commands/index.js'; import { config } from '@/env.js'; +import { pathToFileURL } from 'node:url'; +console.log('Deploying commands...'); export async function deployCommands() { const commandData = [...commands.values()].map((command) => command.data); const rest = new REST({ version: '10' }).setToken(config.discord.token); - const random = Math.floor(Math.random() * 1000); - if (random < 10) { - console.log(`ds ${random}`); - } - try { const result = (await rest.put( Routes.applicationGuildCommands( @@ -34,6 +31,6 @@ export async function deployCommands() { } // If run directly with `node deploy.ts` -if (import.meta.url === `file://${process.argv[1]}`) { - void deployCommands(); +if (import.meta.url === pathToFileURL(process.argv[1]).href) { + await deployCommands(); } From a5153aa6480fee16f1431f1aba4befbb83a9b52e Mon Sep 17 00:00:00 2001 From: Ali Hammoud Date: Sun, 23 Aug 2026 08:37:37 +0300 Subject: [PATCH 2/2] refactor: log inside `deployCommands` --- src/scripts/deploy-commands.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/scripts/deploy-commands.ts b/src/scripts/deploy-commands.ts index 2bd4711..a20cf3e 100644 --- a/src/scripts/deploy-commands.ts +++ b/src/scripts/deploy-commands.ts @@ -6,8 +6,9 @@ import { import { commands } from '@/common/commands/index.js'; import { config } from '@/env.js'; import { pathToFileURL } from 'node:url'; -console.log('Deploying commands...'); + export async function deployCommands() { + console.log('Deploying commands...'); const commandData = [...commands.values()].map((command) => command.data); const rest = new REST({ version: '10' }).setToken(config.discord.token);