Skip to content
Merged
Show file tree
Hide file tree
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
7 changes: 2 additions & 5 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,6 @@ You should see one error about there not being a git tag, and that's fine.
To actually release, run:

```bash
# use `git tag -l | grep cli` to find the latest version and what you want to bump it to
export VERSION=0.1.1
git tag -a v$VERSION -m "Bugfixes"
git push origin v$VERSION
make release
# use `git describe --abbrev=0` to find the latest version and then bump it following https://semver.org/
./scripts/release.sh <version> [description]
```
7 changes: 5 additions & 2 deletions cmd/browsers.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,13 @@ func (b BrowsersCmd) List(ctx context.Context, in BrowsersListInput) error {
return util.CleanedUpSdkError{Err: err}
}

browsers := page.Items
var browsers []kernel.BrowserListResponse
if page != nil {
browsers = page.Items
}

if in.Output == "json" {
if browsers == nil {
if len(browsers) == 0 {
fmt.Println("[]")
return nil
}
Expand Down
15 changes: 15 additions & 0 deletions cmd/browsers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,21 @@ func TestBrowsersList_PrintsEmptyMessage(t *testing.T) {
assert.Contains(t, out, "No running browsers found")
}

func TestBrowsersList_PrintsEmptyMessagePageIsNil(t *testing.T) {
setupStdoutCapture(t)

fake := &FakeBrowsersService{
ListFunc: func(ctx context.Context, query kernel.BrowserListParams, opts ...option.RequestOption) (*pagination.OffsetPagination[kernel.BrowserListResponse], error) {
return nil, nil
},
}
b := BrowsersCmd{browsers: fake}
_ = b.List(context.Background(), BrowsersListInput{})

out := outBuf.String()
assert.Contains(t, out, "No running browsers found")
}

func TestBrowsersList_PrintsTableWithRows(t *testing.T) {
setupStdoutCapture(t)

Expand Down
21 changes: 21 additions & 0 deletions scripts/release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

set -e

if [ -z "$1" ]; then
echo "Error: VERSION is required"
echo "Usage: $0 <VERSION> [DESCRIPTION]"
exit 1
fi

VERSION=$1
if [[ ! "$VERSION" =~ ^[0-9.]+$ ]]; then
echo "Error: VERSION must contain only numbers and periods"
echo "Usage: $0 <VERSION> [DESCRIPTION]"
exit 1
fi
DESCRIPTION=${2:-"Version $VERSION"}

git tag -a v$VERSION -m "$DESCRIPTION"
git push origin v$VERSION
make release