mirror of
https://github.com/sern-handler/cli
synced 2026-06-06 01:16:53 +00:00
remove deprecated application id option for publish
This commit is contained in:
@@ -14,8 +14,6 @@ export async function publish(commandDir: string | undefined, args: Partial<Publ
|
||||
// assign args.import to empty array if non existent
|
||||
args.import ??= [];
|
||||
|
||||
args.token && console.info('Token passed through command line');
|
||||
args.applicationId && console.info(magentaBright('WARNING')+ ' This option is deprecated. Do not pass applicationId through command line');
|
||||
commandDir && console.info('Publishing with override path: ', commandDir);
|
||||
|
||||
const dotenvLocation = new URL('../node_modules/dotenv/config.js', rootPath),
|
||||
@@ -25,10 +23,6 @@ export async function publish(commandDir: string | undefined, args: Partial<Publ
|
||||
// loader flag to require typescript files
|
||||
const command = fork(fileURLToPath(publishScript), [], {
|
||||
execArgv: ['--loader', esmLoader.toString(), '-r', fileURLToPath(dotenvLocation), '--no-warnings'],
|
||||
env: {
|
||||
token: args.token ?? '',
|
||||
applicationId: args.applicationId ?? '',
|
||||
},
|
||||
});
|
||||
// send paths object so we dont have to recalculate it in script
|
||||
command.send({ config, preloads: args.import, commandDir });
|
||||
|
||||
@@ -10,7 +10,7 @@ import { once } from 'node:events';
|
||||
import * as Rest from './rest';
|
||||
import type { sernConfig } from './utilities/getConfig';
|
||||
import type { PublishableData, PublishableModule, Typeable } from './create-publish.d.ts';
|
||||
import { cyanBright, greenBright, magentaBright, redBright } from 'colorette';
|
||||
import { cyanBright, greenBright, redBright } from 'colorette';
|
||||
import { inspect } from 'node:util'
|
||||
import ora from 'ora';
|
||||
|
||||
@@ -144,7 +144,6 @@ const serialize = (permissions: unknown) => {
|
||||
|
||||
const makePublishData = ({ commandModule, config }: Record<string, Record<string, unknown>>) => {
|
||||
const applicationType = intoApplicationType(commandModule.type as number);
|
||||
console.log(config)
|
||||
return {
|
||||
data: {
|
||||
name: commandModule.name as string,
|
||||
@@ -174,11 +173,9 @@ const makePublishData = ({ commandModule, config }: Record<string, Record<string
|
||||
|
||||
// We can use these objects to publish to DAPI
|
||||
const publishableData = modules.map(makePublishData),
|
||||
token = process.env.token || process.env.DISCORD_TOKEN,
|
||||
appid = process.env.applicationId || process.env.APPLICATION_ID;
|
||||
token = process.env.token || process.env.DISCORD_TOKEN;
|
||||
|
||||
assert(token, 'Could not find a token for this bot in .env or commandline. Do you have DISCORD_TOKEN in env?');
|
||||
appid && console.warn(`${magentaBright('WARNING')}: APPLICATION_ID is not necessary anymore`);
|
||||
// partition globally published and guilded commands
|
||||
const [globalCommands, guildedCommands] = publishableData.reduce(
|
||||
([globals, guilded], module) => {
|
||||
|
||||
@@ -40,7 +40,6 @@ program //
|
||||
.option('-W --suppress-warnings', 'suppress experimental warning')
|
||||
.option('-i, --import [scriptPath...]', 'Prerequire a script to load into publisher')
|
||||
.option('-t, --token [token]')
|
||||
.option('--appId [applicationId]')
|
||||
.argument('[path]', 'path with respect to current working directory that will locate all published files')
|
||||
.action(async (...args) => importDynamic('publish.js').then((m) => m.publish(...args)))
|
||||
).addCommand(
|
||||
|
||||
Reference in New Issue
Block a user