Skip to content

Commit 2a9a00e

Browse files
committed
Add -testing flag to deploy_commands
1 parent 683370f commit 2a9a00e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

deploy_commands.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,19 @@ const { clientId, guildId, token } = require('./config.json');
33
const fs = require('node:fs');
44
const path = require('node:path');
55

6-
// Check if -global flag was used
7-
const global = process.argv[2] && process.argv[2] === '-global';
6+
// Check for flags
7+
const global = process.argv.includes('-global');
8+
const testing = process.argv.includes('-testing')
89

910
const commands = [];
1011
// Grab all the command folders from the commands directory
1112
const foldersPath = path.join(__dirname, 'commands');
1213
const commandFolders = fs.readdirSync(foldersPath);
1314

1415
for (const folder of commandFolders) {
16+
// Don't deploy the commands in 'testing/' if -testing flag isn't used
17+
if (!testing && folder === 'testing') continue;
18+
1519
// Grab all the command files from the commands directory
1620
const commandsPath = path.join(foldersPath, folder);
1721
const commandFiles = fs.readdirSync(commandsPath).filter(file => file.endsWith('.js'));

0 commit comments

Comments
 (0)