forked from databricks/terraform-provider-databricks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
43 lines (37 loc) · 994 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
36
37
38
39
40
41
42
43
package main
import (
"fmt"
"log"
"os"
"github.com/databricks/terraform-provider-databricks/common"
"github.com/databricks/terraform-provider-databricks/exporter"
"github.com/databricks/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
}
var debug bool
if len(os.Args) > 1 && os.Args[1] == "debug" {
debug = true
}
log.Printf(`Databricks Terraform Provider
Version %s
https://registry.terraform.io/providers/databricks/databricks/latest/docs
`, common.Version())
plugin.Serve(&plugin.ServeOpts{
ProviderFunc: provider.DatabricksProvider,
ProviderAddr: "registry.terraform.io/databricks/databricks",
Debug: debug,
})
}