This commit is contained in:
Serge Smertin 2022-10-31 12:10:16 +01:00
parent 8cab9d92f3
commit ff117710f6
No known key found for this signature in database
GPG Key ID: 92A95A66446BCE3F
4 changed files with 1 additions and 37 deletions

View File

@ -1,36 +0,0 @@
package main
import (
"context"
"fmt"
"os"
"time"
"github.com/databricks/bricks/lib/ui"
)
func main() {
ctx := context.Background()
err := ui.SpinStages(ctx, []ui.Stage{
{InProgress: "Building", Callback: func(ctx context.Context, status func(string)) error {
time.Sleep(1 * time.Second)
status("first message")
time.Sleep(1 * time.Second)
status("second message")
time.Sleep(1 * time.Second)
return nil
}, Complete: "Built!"},
{InProgress: "Uploading", Callback: func(ctx context.Context, status func(string)) error {
status("third message")
time.Sleep(1 * time.Second)
return nil
}, Complete: "Uploaded!"},
{InProgress: "Installing", Callback: func(ctx context.Context, status func(string)) error {
time.Sleep(1 * time.Second)
return fmt.Errorf("nope")
}, Complete: "Installed!"},
})
if err != nil {
os.Exit(1)
}
}

View File

@ -2,8 +2,8 @@ package main
import (
_ "github.com/databricks/bricks/cmd/api"
_ "github.com/databricks/bricks/cmd/build"
_ "github.com/databricks/bricks/cmd/configure"
_ "github.com/databricks/bricks/cmd/deploy"
_ "github.com/databricks/bricks/cmd/fs"
_ "github.com/databricks/bricks/cmd/init"
_ "github.com/databricks/bricks/cmd/launch"