Content-Length: 1763 | pFad | http://github.com/github/github-mcp-server/pull/13.patch
thub.com
From a2e662abb9e617ca58fcfe76b7ff5f5379101904 Mon Sep 17 00:00:00 2001
From: Javier Uruen Val
Date: Fri, 14 Mar 2025 19:17:41 +0100
Subject: [PATCH] fix issue with log-file arg
---
cmd/server/main.go | 7 +++----
go.mod | 2 +-
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/cmd/server/main.go b/cmd/server/main.go
index 8d09f5242..a4266a00d 100644
--- a/cmd/server/main.go
+++ b/cmd/server/main.go
@@ -21,10 +21,6 @@ var (
Use: "server",
Short: "GitHub MCP Server",
Long: `A GitHub MCP server that handles various tools and resources.`,
- PersistentPreRun: func(cmd *cobra.Command, args []string) {
- // Bind flag to viper
- viper.BindPFlag("log-file", cmd.PersistentFlags().Lookup("log-file"))
- },
}
stdioCmd = &cobra.Command{
@@ -50,6 +46,9 @@ func init() {
// Add global flags that will be shared by all commands
rootCmd.PersistentFlags().String("log-file", "", "Path to log file")
+ // Bind flag to viper
+ viper.BindPFlag("log-file", rootCmd.PersistentFlags().Lookup("log-file"))
+
// Add subcommands
rootCmd.AddCommand(stdioCmd)
}
diff --git a/go.mod b/go.mod
index 43e0dffc2..21711c207 100644
--- a/go.mod
+++ b/go.mod
@@ -8,6 +8,7 @@ require (
github.com/sirupsen/logrus v1.9.3
github.com/spf13/cobra v1.9.1
github.com/spf13/viper v1.19.0
+ golang.org/x/exp v0.0.0-20230905200255-921286631fa9
)
require (
@@ -28,7 +29,6 @@ require (
github.com/subosito/gotenv v1.6.0 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.9.0 // indirect
- golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
--- a PPN by Garber Painting Akron. With Image Size Reduction included!Fetched URL: http://github.com/github/github-mcp-server/pull/13.patch
Alternative Proxies:
Alternative Proxy
pFad Proxy
pFad v3 Proxy
pFad v4 Proxy