mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-22 11:17:05 +02:00
feat: cleaned up directories
This commit is contained in:
1 parent
473ebfa46c
commit
613527e78f
41 files changed
+116
-832
No files matched your search
@@ -0,0 +1,21 @@
|
||||
import { argv } from 'process';
|
||||
|
||||
type ArgumentName = 'discord-token' | 'wargaming-application-id';
|
||||
|
||||
export const args: Record<ArgumentName, string> = {
|
||||
'discord-token': '',
|
||||
'wargaming-application-id': '',
|
||||
};
|
||||
|
||||
argv.forEach((arg) => {
|
||||
if (arg.includes('=')) {
|
||||
const [name, value] = arg.split('=');
|
||||
args[name as ArgumentName] = value;
|
||||
}
|
||||
});
|
||||
|
||||
Object.keys(args).forEach((arg) => {
|
||||
if (args[arg as ArgumentName] === '') {
|
||||
throw new Error(`Missing argument: ${arg}`);
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,6 @@
|
||||
import discord from '../../../discord.json' assert { type: 'json' };
|
||||
import isDev from './isDev.js';
|
||||
|
||||
export default function getClientId() {
|
||||
return isDev() ? discord.client_id_dev : discord.client_id;
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
const isDevBoolean = process.argv.includes('--dev');
|
||||
|
||||
export default function isDev() {
|
||||
return isDevBoolean;
|
||||
}
|
||||
Reference in new issue
Block a user