Skip to content

Commit e564502

Browse files
committed
support '-device configure'
1 parent 5dff4f1 commit e564502

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

main.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,11 +380,17 @@ func main() {
380380
// six hours
381381
storage = "cache --timeout 21600"
382382
}
383+
helper := "oauth"
384+
if device {
385+
helper += " -device"
386+
}
383387
commands = []*exec.Cmd{exec.Command(gitPath, "config", "--global", "--unset-all", "credential.helper"),
384388
exec.Command(gitPath, "config", "--global", "--add", "credential.helper", storage),
385-
exec.Command(gitPath, "config", "--global", "--add", "credential.helper", "oauth")}
389+
exec.Command(gitPath, "config", "--global", "--add", "credential.helper", helper),
390+
}
386391
} else if args[0] == "unconfigure" {
387-
commands = []*exec.Cmd{exec.Command(gitPath, "config", "--global", "--unset-all", "credential.helper", "oauth")}
392+
commands = []*exec.Cmd{
393+
exec.Command(gitPath, "config", "--global", "--unset-all", "credential.helper", "oauth*")}
388394
}
389395
for _, cmd := range commands {
390396
cmd.Stderr = os.Stderr

0 commit comments

Comments
 (0)