working on lock command

This commit is contained in:
2020-06-08 22:52:40 -04:00
parent c2e74ce7f4
commit 441a9ed233
9 changed files with 132 additions and 48 deletions

View File

@@ -36,11 +36,18 @@ func FindServer(serverName string, branchName string, conf *clientconfig.Gvcconf
if branchName == "" { // If no branch listed select master TODO: in future the 'default' branch will be their current branch
branchName = "master"
}
if serverName == "" { // if no serverName is specified, just use the default
for _, remote := range conf.Remotes {
if remote.Default {
serverName = remote.Name
}
}
}
for _, remote := range conf.Remotes {
if serverName == remote.Name {
fmt.Printf("Server found in config, connecting to: %s, host: %s, port: %d \n", remote.Name, remote.Host, remote.Port)
port := ":" + strconv.Itoa(remote.Port)
connectionString := "http://" + remote.Host + port + "/" + conf.RepoName //Create our connection string //'http://server:port/:repo' //TODO, what about admin commands for entire server management, not just one repo?
connectionString := "http://" + remote.Host + port //Create our connection string //'http://server:port'
fmt.Println("Generated connection string: ", connectionString)
return connectionString, nil
}