forked from databricks/terraform-provider-databricks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
35 lines (29 loc) · 851 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package main
import (
"fmt"
"log"
"os"
"github.com/databrickslabs/terraform-provider-databricks/common"
"github.com/databrickslabs/terraform-provider-databricks/exporter"
"github.com/databrickslabs/terraform-provider-databricks/provider"
"github.com/hashicorp/terraform-plugin-sdk/v2/plugin"
)
func main() {
log.SetFlags(0)
if len(os.Args) > 1 && os.Args[1] == "version" {
fmt.Println(common.Version())
return
}
if len(os.Args) > 1 && os.Args[1] == "exporter" {
if err := exporter.Run(os.Args...); err != nil {
log.Printf("[ERROR] %s", err.Error())
os.Exit(1)
}
return
}
log.Printf(`Databricks Terraform Provider (experimental)
Version %s
https://registry.terraform.io/providers/databrickslabs/databricks/latest/docs
`, common.Version())
plugin.Serve(&plugin.ServeOpts{ProviderFunc: provider.DatabricksProvider})
}