Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
feat: cli configs should not be space sensitive
If you edit the file and add a newline, it breaks. It should not matter
  • Loading branch information
Emyrk committed May 23, 2022
commit 63579ca64aee3543bbe7b6fd392d37ada5c261b3
5 changes: 3 additions & 2 deletions cli/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"
"net/url"
"os"
"strings"
"time"

"github.com/kirsle/configdir"
Expand Down Expand Up @@ -115,7 +116,7 @@ func createClient(cmd *cobra.Command) (*codersdk.Client, error) {
return nil, err
}
}
serverURL, err := url.Parse(rawURL)
serverURL, err := url.Parse(strings.TrimSpace(rawURL))
if err != nil {
return nil, err
}
Expand All @@ -127,7 +128,7 @@ func createClient(cmd *cobra.Command) (*codersdk.Client, error) {
}
}
client := codersdk.New(serverURL)
client.SessionToken = token
client.SessionToken = strings.TrimSpace(token)
return client, nil
}

Expand Down