Skip to content

Commit 200af98

Browse files
authored
Set default branch to main
1 parent ddca3ca commit 200af98

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

gitpaths.go

+7-3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"os"
99
"strings"
1010
)
11+
1112
const yellow = "\033[33m"
1213
const reset = "\033[0m"
1314

@@ -33,13 +34,16 @@ type ApiResponse struct {
3334
func main() {
3435
repoUrl := flag.String("u", "", "GitHub repository URL")
3536
outputFile := flag.String("o", "", "Output file (optional)")
36-
branch := flag.String("b", "master", "Branch name (optional)")
37+
branch := flag.String("b", "main", "Branch name (default: main)")
3738
silent := flag.Bool("silent", false, "Omit banner and sysout printing")
3839
help := flag.Bool("help", false, "Display help")
3940

4041
flag.Parse()
4142

42-
fmt.Print(banner)
43+
// Display banner if not in silent mode
44+
if !*silent {
45+
fmt.Print(banner)
46+
}
4347

4448
// Display help if -h is provided
4549
if *help {
@@ -74,7 +78,7 @@ func main() {
7478
defer resp.Body.Close()
7579

7680
if resp.StatusCode != http.StatusOK {
77-
fmt.Printf("Failed to retrieve data: %s\n", resp.Status)
81+
fmt.Printf("Failed to retrieve data: %s\nVerify that the branch you want to retrieve is %s. If not, specify it with -b", resp.Status, *branch)
7882
os.Exit(1)
7983
}
8084

0 commit comments

Comments
 (0)