2019-07-11 23:59:04 +02:00
|
|
|
package cmd
|
|
|
|
|
|
|
|
import (
|
|
|
|
"io/ioutil"
|
|
|
|
"log"
|
|
|
|
"os"
|
|
|
|
|
2019-08-01 20:43:59 +02:00
|
|
|
"github.com/mcuadros/ascode/starlark/runtime"
|
|
|
|
"github.com/mcuadros/ascode/terraform"
|
2019-07-11 23:59:04 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
log.SetOutput(ioutil.Discard)
|
|
|
|
}
|
|
|
|
|
|
|
|
type commonCmd struct {
|
|
|
|
PluginDir string `long:"plugin-dir" description:"directory containing plugin binaries" default:"$HOME/.terraform.d/plugins"`
|
|
|
|
|
|
|
|
runtime *runtime.Runtime
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *commonCmd) init() {
|
|
|
|
c.runtime = runtime.NewRuntime(&terraform.PluginManager{
|
|
|
|
Path: os.ExpandEnv(c.PluginDir)},
|
|
|
|
)
|
|
|
|
}
|