Skip to content

Commit d21abb6

Browse files
Merge pull request #12 from coherenceplatform/aa/cocliv1
cocli v1.0.2 - cnc command improvements
2 parents 794dbe2 + 2f78bf1 commit d21abb6

3 files changed

Lines changed: 10 additions & 6 deletions

File tree

cmd/cocli/cnc.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,19 @@ var cncCmd = &cobra.Command{
7070
panic(err)
7171
}
7272

73-
// Build the command with the new argument structure
74-
commandArgs := []string{"-e", outputFile, "-f", outputFile}
75-
commandArgs = append(commandArgs, args...)
73+
env := os.Environ()
74+
env = append(
75+
env,
76+
fmt.Sprintf("CNC_CONFIG_PATH=%s", outputFile),
77+
fmt.Sprintf("CNC_ENVIRONMENTS_PATH=%s", outputFile),
78+
)
7679

7780
// Run a shell command using the arguments passed to the Cobra command
78-
cmdExec := exec.Command("cnc", commandArgs...)
81+
cmdExec := exec.Command("cnc", args...)
7982
cmdExec.Stdin = os.Stdin
8083
cmdExec.Stdout = os.Stdout
8184
cmdExec.Stderr = os.Stderr
85+
cmdExec.Env = env
8286

8387
if err := cmdExec.Run(); err != nil {
8488
fmt.Printf("Error running command: %v\n", err)

cocli_version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.0.1
1+
1.0.2

pkg/cocli/cocli.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ var prodConfig = &CocliConfig{
2424
CoherenceDomain: "https://beta.withcoherence.com",
2525
}
2626

27-
const cliVersion = "1.0.1"
27+
const cliVersion = "1.0.2"
2828

2929
func GetCliConfig() CocliConfig {
3030
if strings.ToLower(os.Getenv("COHERENCE_ENVIRONMENT")) == "review" {

0 commit comments

Comments
 (0)