mirror of https://github.com/databricks/cli.git
iterate
This commit is contained in:
parent
8cab9d92f3
commit
ff117710f6
|
@ -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)
|
||||
}
|
||||
}
|
2
main.go
2
main.go
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue