2023-03-09 09:26:56 +00:00
|
|
|
package bundle
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
|
2023-05-16 16:35:39 +00:00
|
|
|
"github.com/databricks/cli/cmd/root"
|
2023-03-09 09:26:56 +00:00
|
|
|
"github.com/spf13/cobra"
|
|
|
|
)
|
|
|
|
|
2023-07-27 10:03:08 +00:00
|
|
|
func newLaunchCommand() *cobra.Command {
|
|
|
|
cmd := &cobra.Command{
|
|
|
|
Use: "launch",
|
|
|
|
Short: "Launches a notebook on development cluster",
|
|
|
|
Long: `Reads a file and executes it on dev cluster`,
|
2024-03-12 14:12:34 +00:00
|
|
|
Args: root.ExactArgs(1),
|
2023-03-09 09:26:56 +00:00
|
|
|
|
2023-07-27 10:03:08 +00:00
|
|
|
// We're not ready to expose this command until we specify its semantics.
|
|
|
|
Hidden: true,
|
|
|
|
}
|
|
|
|
|
|
|
|
cmd.RunE = func(cmd *cobra.Command, args []string) error {
|
2023-03-09 09:26:56 +00:00
|
|
|
return fmt.Errorf("TODO")
|
|
|
|
// contents, err := os.ReadFile(args[0])
|
|
|
|
// if err != nil {
|
|
|
|
// return err
|
|
|
|
// }
|
|
|
|
// results := project.RunPythonOnDev(cmd.Context(), string(contents))
|
|
|
|
// if results.Failed() {
|
|
|
|
// return results.Err()
|
|
|
|
// }
|
|
|
|
// fmt.Fprintf(cmd.OutOrStdout(), "Success: %s", results.Text())
|
|
|
|
// return nil
|
2023-07-27 10:03:08 +00:00
|
|
|
}
|
2023-03-09 09:26:56 +00:00
|
|
|
|
2023-07-27 10:03:08 +00:00
|
|
|
return cmd
|
2023-03-09 09:26:56 +00:00
|
|
|
}
|