Skip to content

Commit 09366fa

Browse files
authored
Merge pull request #13 from github/juruen/fix-log-file
fix issue with log-file arg
2 parents 6c4bbf0 + bb9f2b8 commit 09366fa

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

cmd/server/main.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@ var (
2121
Use: "server",
2222
Short: "GitHub MCP Server",
2323
Long: `A GitHub MCP server that handles various tools and resources.`,
24-
PersistentPreRun: func(cmd *cobra.Command, args []string) {
25-
// Bind flag to viper
26-
viper.BindPFlag("log-file", cmd.PersistentFlags().Lookup("log-file"))
27-
},
2824
}
2925

3026
stdioCmd = &cobra.Command{
@@ -50,6 +46,9 @@ func init() {
5046
// Add global flags that will be shared by all commands
5147
rootCmd.PersistentFlags().String("log-file", "", "Path to log file")
5248

49+
// Bind flag to viper
50+
viper.BindPFlag("log-file", rootCmd.PersistentFlags().Lookup("log-file"))
51+
5352
// Add subcommands
5453
rootCmd.AddCommand(stdioCmd)
5554
}

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@ module github.com/github/github-mcp-server
33
go 1.23.7
44

55
require (
6+
github.com/aws/smithy-go v1.22.3
67
github.com/google/go-github/v69 v69.2.0
78
github.com/mark3labs/mcp-go v0.11.2
89
github.com/sirupsen/logrus v1.9.3
910
github.com/spf13/cobra v1.9.1
1011
github.com/spf13/viper v1.19.0
11-
github.com/aws/smithy-go v1.22.3
12+
golang.org/x/exp v0.0.0-20230905200255-921286631fa9
1213
)
1314

1415
require (
@@ -29,7 +30,6 @@ require (
2930
github.com/subosito/gotenv v1.6.0 // indirect
3031
go.uber.org/atomic v1.9.0 // indirect
3132
go.uber.org/multierr v1.9.0 // indirect
32-
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
3333
golang.org/x/sys v0.18.0 // indirect
3434
golang.org/x/text v0.14.0 // indirect
3535
gopkg.in/ini.v1 v1.67.0 // indirect

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy