mirror of
https://github.com/sern-handler/cli
synced 2026-06-06 01:16:53 +00:00
feat: add more methods
This commit is contained in:
@@ -8,7 +8,8 @@ import { fromCwd } from '../utilities/fromCwd.js';
|
||||
/**
|
||||
* Installs plugins to project
|
||||
*/
|
||||
export async function plugins() {
|
||||
export async function plugins(options: PluginOptions) {
|
||||
console.log(options)
|
||||
const e: string[] = (await prompt([await pluginsQ()])).list;
|
||||
if (!e) process.exit(1);
|
||||
|
||||
@@ -38,3 +39,9 @@ async function download(url: string) {
|
||||
}
|
||||
fs.writeFileSync(filedir, data);
|
||||
}
|
||||
|
||||
interface PluginOptions {
|
||||
name?: string;
|
||||
save: boolean
|
||||
|
||||
}
|
||||
|
||||
17
src/index.ts
17
src/index.ts
@@ -22,14 +22,15 @@ program
|
||||
.option('-s, --sync', 'Syncs the project and generates sern.config.json')
|
||||
.action(init);
|
||||
|
||||
program
|
||||
.command(plugins.name)
|
||||
.description(
|
||||
'Install plugins from https://github.com/sern-handler/awesome-plugins'
|
||||
)
|
||||
.option('-n --name', 'Name of plugin')
|
||||
.action(plugins);
|
||||
|
||||
const pluginCommand = program.command(plugins.name)
|
||||
pluginCommand
|
||||
.description(
|
||||
'Get plugins from https://github.com/sern-handler/awesome-plugins'
|
||||
)
|
||||
.option('-n --name', 'Name of plugin')
|
||||
.option('-S --save', 'Save and keep plugins updated')
|
||||
.action(plugins);
|
||||
|
||||
program
|
||||
.command(extra.name)
|
||||
.description('Easy way to add extra things in your sern project')
|
||||
|
||||
Reference in New Issue
Block a user