mirror of
https://github.com/sern-handler/cli
synced 2026-06-28 02:32:20 +00:00
feat: list subcommand (#113)
* chore: progress * chore: blaming regex. permalink: http://whatthecommit.com/7eaa73b94ca6e8f964d99b6f2db6e9e4 * chore: permalink: * chore: lol * chore: accidental commit permalink: http://whatthecommit.com/7c6c9323d8c243d10cd93c8bbbc55d09 * fix syntx * fix list not showing up * prety * chore: refresh lockfile * chore: progress * fix list not showing up * refactor: cleanup some mess * Update preprocessor.ts --------- Co-authored-by: Jacob Nguyen <76754747+jacoobes@users.noreply.github.com>
This commit is contained in:
17
src/utilities/getSern.ts
Normal file
17
src/utilities/getSern.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { readdirSync } from 'node:fs';
|
||||
import { fromCwd } from './fromCwd';
|
||||
import { redBright, cyanBright } from 'colorette';
|
||||
|
||||
export function getSern() {
|
||||
let files: string[] = [];
|
||||
|
||||
try {
|
||||
const sern = fromCwd('.sern');
|
||||
files = readdirSync(sern);
|
||||
} catch (error) {
|
||||
console.error(`${redBright('Error:')} Could not locate ${cyanBright('.sern')} directory`);
|
||||
process.exit(1);
|
||||
} finally {
|
||||
return files;
|
||||
}
|
||||
}
|
||||
@@ -1 +1,35 @@
|
||||
export type PackageManagerChoice = 'skip' | 'npm' | 'yarn';
|
||||
|
||||
export type GuildId = string;
|
||||
|
||||
export interface CommandData {
|
||||
id: string;
|
||||
application_id: string;
|
||||
version: string;
|
||||
default_member_permissions?: string;
|
||||
type: number;
|
||||
name: string;
|
||||
name_localizations?: Record<string, string>;
|
||||
description: string;
|
||||
description_localizations?: Record<string, string>;
|
||||
dm_permission: boolean;
|
||||
guild_id: string;
|
||||
nsfw: boolean;
|
||||
options?: OptionData[];
|
||||
}
|
||||
|
||||
interface OptionData {
|
||||
type: number;
|
||||
name: string;
|
||||
name_localizations?: Record<string, string>;
|
||||
description: string;
|
||||
description_localizations?: Record<string, string>;
|
||||
required?: boolean;
|
||||
choices?: ChoiceData[];
|
||||
options?: OptionData[];
|
||||
}
|
||||
|
||||
interface ChoiceData {
|
||||
name: string;
|
||||
value: string | number;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user