Files
gitlab.nvim/cmd/main.go
Harrison (Harry) Cramer ea2b2b2f5c Fix MR Selection, Go Code Refactor (#358)
refactor: Refactors the Go codebase into a more modular and idiomatic approach
fix: require selection of specific MR when there are multiple targets for a given source branch
feat: Allows for the passing of Gitlab's filter options when choosing an MR, improves MR selection
feat: API to choose an MR from a list based on the provided username's involvement as an assignee/reviewer/author

This is a #MINOR release
2024-09-08 16:45:09 -04:00

43 lines
896 B
Go

package main
import (
"encoding/json"
"log"
"os"
"github.com/harrisoncramer/gitlab.nvim/cmd/app"
"github.com/harrisoncramer/gitlab.nvim/cmd/app/git"
)
var pluginOptions app.PluginOptions
func main() {
log.SetFlags(0)
err := json.Unmarshal([]byte(os.Args[1]), &pluginOptions)
app.SetPluginOptions(pluginOptions)
if err != nil {
log.Fatalf("Failure parsing plugin settings: %v", err)
}
gitManager := git.Git{}
gitData, err := git.NewGitData(pluginOptions.ConnectionSettings.Remote, gitManager)
if err != nil {
log.Fatalf("Failure initializing plugin: %v", err)
}
err, client := app.NewClient()
if err != nil {
log.Fatalf("Failed to initialize Gitlab client: %v", err)
}
err, projectInfo := app.InitProjectSettings(client, gitData)
if err != nil {
log.Fatalf("Failed to initialize project settings: %v", err)
}
app.StartServer(client, projectInfo, gitData)
}