mirror of
https://github.com/samuelthomas2774/nxapi.git
synced 2026-10-13 12:59:47 -05:00
Remote configuration
This commit is contained in:
@@ -3,3 +3,4 @@ export * as validateDiscordTitles from './validate-discord-titles.js';
|
||||
export * as exportDiscordTitles from './export-discord-titles.js';
|
||||
export * as discordActivity from './discord-activity.js';
|
||||
export * as discordRpc from './discord-rpc.js';
|
||||
export * as remoteConfig from './remote-config.js';
|
||||
|
||||
35
src/cli/util/remote-config.ts
Normal file
35
src/cli/util/remote-config.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import createDebug from 'debug';
|
||||
import type { Arguments as ParentArguments } from '../util.js';
|
||||
import { ArgumentsCamelCase, Argv, YargsArguments } from '../../util/yargs.js';
|
||||
|
||||
const debug = createDebug('cli:util:remote-config');
|
||||
|
||||
export const command = 'remote-config';
|
||||
export const desc = 'Show nxapi remote configuration';
|
||||
|
||||
export function builder(yargs: Argv<ParentArguments>) {
|
||||
return yargs.option('json', {
|
||||
describe: 'Output raw JSON',
|
||||
type: 'boolean',
|
||||
}).option('json-pretty-print', {
|
||||
describe: 'Output pretty-printed JSON',
|
||||
type: 'boolean',
|
||||
});
|
||||
}
|
||||
|
||||
type Arguments = YargsArguments<ReturnType<typeof builder>>;
|
||||
|
||||
export async function handler(argv: ArgumentsCamelCase<Arguments>) {
|
||||
const { default: config } = await import('../../common/remote-config.js');
|
||||
|
||||
if (argv.jsonPrettyPrint) {
|
||||
console.log(JSON.stringify(config, null, 4));
|
||||
return;
|
||||
}
|
||||
if (argv.json) {
|
||||
console.log(JSON.stringify(config));
|
||||
return;
|
||||
}
|
||||
|
||||
console.log('Remote config', config);
|
||||
}
|
||||
Reference in New Issue
Block a user