summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md4
-rw-r--r--internal/cli/handlers.go4
-rw-r--r--internal/cmd/root.go2
-rw-r--r--internal/config/config.go4
4 files changed, 7 insertions, 7 deletions
diff --git a/README.md b/README.md
index c3a9ed2..ee175c4 100644
--- a/README.md
+++ b/README.md
@@ -39,7 +39,7 @@ go build -o gitsyncer ./cmd/gitsyncer
## Configuration
-Create a configuration file at `~/.config/gitsyncer/config` (or specify a custom path with `-c`):
+Create a configuration file at `~/.config/gitsyncer/config.json` (or specify a custom path with `-c`):
```json
{
@@ -251,7 +251,7 @@ gitsyncer version
These options are available for all commands:
-- `-c, --config` - Path to configuration file (default: ~/.config/gitsyncer/config)
+- `-c, --config` - Path to configuration file (default: ~/.config/gitsyncer/config.json)
- `-w, --work-dir` - Working directory (default: ~/git/gitsyncer-workdir)
- `-h, --help` - Show help for any command
diff --git a/internal/cli/handlers.go b/internal/cli/handlers.go
index 44c64c6..02df7ae 100644
--- a/internal/cli/handlers.go
+++ b/internal/cli/handlers.go
@@ -69,7 +69,7 @@ func findDefaultConfigPath() string {
// Check common config locations
configLocations := []string{
filepath.Join(".", "gitsyncer.json"),
- filepath.Join(home, ".config", "gitsyncer", "config"),
+ filepath.Join(home, ".config", "gitsyncer", "config.json"),
filepath.Join(home, ".gitsyncer.json"),
}
@@ -88,7 +88,7 @@ func ShowConfigHelp() {
fmt.Println("No configuration file found. Please create one of:")
fmt.Printf(" - ./gitsyncer.json\n")
- fmt.Printf(" - %s/.config/gitsyncer/config\n", home)
+ fmt.Printf(" - %s/.config/gitsyncer/config.json\n", home)
fmt.Printf(" - %s/.gitsyncer.json\n", home)
fmt.Println("\nOr specify a config file with --config flag")
fmt.Println("\nExample configuration:")
diff --git a/internal/cmd/root.go b/internal/cmd/root.go
index 927a9b8..bf4f64a 100644
--- a/internal/cmd/root.go
+++ b/internal/cmd/root.go
@@ -53,7 +53,7 @@ func Execute() {
func init() {
// Global flags
- rootCmd.PersistentFlags().StringVarP(&cfgFile, "config", "c", "", "configuration file (default: ~/.config/gitsyncer/config)")
+ rootCmd.PersistentFlags().StringVarP(&cfgFile, "config", "c", "", "configuration file (default: ~/.config/gitsyncer/config.json)")
// Set default work directory
home, err := os.UserHomeDir()
diff --git a/internal/config/config.go b/internal/config/config.go
index a141c81..86c474f 100644
--- a/internal/config/config.go
+++ b/internal/config/config.go
@@ -34,8 +34,8 @@ func Load(path string) (*Config, error) {
if err != nil {
return nil, fmt.Errorf("failed to get home directory: %w", err)
}
- // Use XDG config directory
- path = filepath.Join(home, ".config", "gitsyncer", "config")
+ // Use XDG config directory with .json extension
+ path = filepath.Join(home, ".config", "gitsyncer", "config.json")
} else if len(path) >= 2 && path[:2] == "~/" {
// Expand home directory if needed
home, err := os.UserHomeDir()