Skip to content

Commit

Permalink
remove the path parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
unglaublicherdude committed Mar 1, 2024
1 parent 975b6fb commit 68bf4a6
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions golang/vaas/cmd/git-scan/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,31 +15,22 @@ import (
)

func main() {
if len(os.Args) < 3 {
log.Fatal("need 2 parameter: path, targetBranch")
}
path := os.Args[1]
if path == "" {
log.Fatal("no path set")
if len(os.Args) < 2 {
log.Fatal("need 2 parameter: targetBranch")
}

targetBranch := os.Args[2]
targetBranch := os.Args[1]
if targetBranch == "" {
log.Fatal("no targetBranch set")
}
remote := ""
if len(os.Args) > 3 {
remote = os.Args[3]
if len(os.Args) > 2 {
remote = os.Args[2]
}
if remote == "" {
remote = "origin"
}

err := os.Chdir(path)
if err != nil {
log.Fatal(err)
}

clientID, exists := os.LookupEnv("CLIENT_ID")
if !exists {
log.Fatal("no Client ID set")
Expand Down

0 comments on commit 68bf4a6

Please sign in to comment.