feat: add more methods

This commit is contained in:
jacoobes
2023-02-16 12:07:16 -06:00
parent a3f5f1bf52
commit 731017f637
2 changed files with 17 additions and 9 deletions

View File

@@ -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
}

View File

@@ -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')