-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Expand file tree
/
Copy pathhook_module_install.go
More file actions
33 lines (27 loc) · 854 Bytes
/
hook_module_install.go
File metadata and controls
33 lines (27 loc) · 854 Bytes
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
package command
import (
"fmt"
version "github.com/hashicorp/go-version"
"github.com/hashicorp/terraform/configs/configload"
"github.com/mitchellh/cli"
)
type uiModuleInstallHooks struct {
configload.InstallHooksImpl
Ui cli.Ui
ShowLocalPaths bool
}
var _ configload.InstallHooks = uiModuleInstallHooks{}
func (h uiModuleInstallHooks) Download(modulePath, packageAddr string, v *version.Version) {
if v != nil {
h.Ui.Info(fmt.Sprintf("Downloading %s %s for %s...", packageAddr, v, modulePath))
} else {
h.Ui.Info(fmt.Sprintf("Downloading %s for %s...", packageAddr, modulePath))
}
}
func (h uiModuleInstallHooks) Install(modulePath string, v *version.Version, localDir string) {
if h.ShowLocalPaths {
h.Ui.Info(fmt.Sprintf("- %s in %s", modulePath, localDir))
} else {
h.Ui.Info(fmt.Sprintf("- %s", modulePath))
}
}