-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
29 lines (24 loc) · 866 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
package main
import (
"log"
"github.com/akhilsharma90/terraform-assistant/cmd/cli"
"github.com/akhilsharma90/terraform-assistant/pkg/utils"
)
// It initializes the working directory and the Terraform executable directory,
// then calls the InitAndExecute function to start the program.
func main() {
// Get the current working directory
workingDir, err := utils.CurrenDir()
if err != nil {
log.Fatalf("Failed get current dir: %s\n", err.Error())
}
// Get the Terraform executable directory
execDir, err := utils.TerraformPath()
if err != nil {
log.Fatalf("Failed get exec dir: %s\n", err.Error())
}
//the current directory and terraform executable directory that we have retrieved
//by calling the helper functions above, we will pass to initandExecute function
// Initialize and execute the program
cli.InitAndExecute(workingDir, execDir)
}