Skip to content

Commit

Permalink
Renaming packeges, functions, coderefactor
Browse files Browse the repository at this point in the history
  • Loading branch information
lovestaco committed Aug 16, 2023
1 parent c9a2bc1 commit 6689711
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import (

"github.com/HexmosTech/gabs/v2"
"github.com/HexmosTech/httpie-go"
env "github.com/HexmosTech/lama2/Env"
"github.com/HexmosTech/lama2/cmdexec"
"github.com/HexmosTech/lama2/cmdgen"
"github.com/HexmosTech/lama2/codegen"
env "github.com/HexmosTech/lama2/l2env"
"github.com/HexmosTech/lama2/lama2cmd"
outputmanager "github.com/HexmosTech/lama2/outputManager"
"github.com/HexmosTech/lama2/parser"
Expand Down
1 change: 1 addition & 0 deletions Env/env.go → l2env/l2env.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ func ProcessEnvironmentVariables(o *lama2cmd.Opts, directory string) {
relevantEnvs := GetRelevantEnvs(envMap, o)
utils.MarshalAndPrintJSON(relevantEnvs)
}
os.Exit(0)
}
// If not an -e invocation, the function just continues.
}
Expand Down
12 changes: 6 additions & 6 deletions tests/utils/test_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ type EnvData struct {
Val string `json:"val"`
}

func checkL2BinaryExists(l2BinPath string) error {
func checkLocalL2BinaryExists(l2BinPath string) error {
if _, err := os.Stat(l2BinPath); os.IsNotExist(err) {
return fmt.Errorf("l2 binary not found in the build folder %s, please change the path", l2BinPath)
}
return nil
}

func getL2BinaryPath() (string, error) {
func getLocalL2BinaryPath() (string, error) {
l2BinPath := "../build/l2"
err := checkL2BinaryExists(l2BinPath)
err := checkLocalL2BinaryExists(l2BinPath)
if err != nil {
return "", err
}
Expand All @@ -50,7 +50,7 @@ func runCommand(binPath string, cmdArgs ...string) (string, error) {
}

func RunL2CommandAndGetOutput(cmdArgs ...string) (string, error) {
l2BinPath, err := getL2BinaryPath()
l2BinPath, err := getLocalL2BinaryPath()
if err != nil {
return "", err
}
Expand All @@ -59,7 +59,7 @@ func RunL2CommandAndGetOutput(cmdArgs ...string) (string, error) {
}

func RunL2CommandAndParseJSON(cmdArgs ...string) (map[string]EnvData, error) {
l2BinPath, err := getL2BinaryPath()
l2BinPath, err := getLocalL2BinaryPath()
if err != nil {
return nil, err
}
Expand All @@ -72,7 +72,7 @@ func RunL2CommandAndParseJSON(cmdArgs ...string) (map[string]EnvData, error) {
envMap := make(map[string]EnvData)
err = json.Unmarshal([]byte(output), &envMap)
if err != nil {
return nil, fmt.Errorf("Error unmarshaling JSON env: %v\nOutput:\n%s", err, output)
return nil, fmt.Errorf("error unmarshaling JSON env: %v\nOutput:\n%s", err, output)
}

return envMap, nil
Expand Down
1 change: 0 additions & 1 deletion utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,5 +146,4 @@ func MarshalAndPrintJSON(data interface{}) {
os.Exit(0)
}
fmt.Println(string(filteredJSON))
os.Exit(0)
}

0 comments on commit 6689711

Please sign in to comment.