Skip to content

Conversation

carolynvs
Copy link
Member

I'm playing around with making a library for making plugins so that people don't have to implement the boilerplate stuff.

Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com>
@carolynvs carolynvs added the playground 🙈 Pull request to try stuff out and see if it builds. Don't look! label Jun 30, 2022
@carolynvs
Copy link
Member Author

This is the new tiny main function for porter, and it would look the same for a plugin

func main() {
	ctx := context.Background()
	app := porter.New()
	rootCmd := buildRootCommandFrom(app)

	cli.Main(ctx, rootCmd, app)
}

It shoves in all the logic we have for telemetry, context cancellation, panic handling, etc into this new package pkg/cli

Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com>
Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com>
Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
playground 🙈 Pull request to try stuff out and see if it builds. Don't look!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant