setup

package
v0.1.31 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2026 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Package setup provides commands for initializing and configuring the bookmark database. It handles database creation, initial schema setup, and optional Git repository tracking.

Index

Constants

This section is empty.

Variables

View Source
var InitCmd = &cobra.Command{
	Use:               "init",
	Short:             "Initialize a new bookmarks database",
	Hidden:            true,
	Annotations:       cli.SkipDBCheckAnnotation,
	PersistentPreRunE: cli.HookCheckIfDatabaseInitialized,
	RunE: func(cmd *cobra.Command, args []string) error {
		cfg, err := config.FromContext(cmd.Context())
		if err != nil {
			return fmt.Errorf("failed to get config: %w", err)
		}

		return initializeAction(app.New(cmd.Context(),
			app.WithConfig(cfg),
			app.WithConsole(ui.NewDefaultConsole(cmd.Context(), func(err error) { sys.ErrAndExit(err) })),
		))
	},
	PostRunE: InitAppPostFunc,
}

Functions

func InitAppPostFunc

func InitAppPostFunc(cmd *cobra.Command, _ []string) error

InitAppPostFunc ask user to track new database if git is initialized.

func NewCmd

func NewCmd() *cobra.Command

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL