Skip to content

Commit f3942b3

Browse files
Tidy output
1 parent 650c320 commit f3942b3

File tree

2 files changed

+23
-12
lines changed

2 files changed

+23
-12
lines changed

cmd/env.go

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,17 @@ func newEnvCmd(e shipyard.Engine) *cobra.Command {
1717
Long: "Prints environment variables defined by the blueprint",
1818
Example: `
1919
# Display environment variables
20-
shipyard env
21-
22-
VAR1=value
23-
VAR2=value
24-
25-
# Set environemnt variables
26-
eval $(shipyard env)
27-
`,
20+
shipyard env
21+
22+
VAR1=value
23+
VAR2=value
24+
25+
# Set environment variables on Linux based systems
26+
eval $(shipyard env)
27+
28+
# Set environment variables on Windows based systems
29+
@FOR /f "tokens=*" %i IN ('shipyard env') DO @%
30+
`,
2831
Args: cobra.ArbitraryArgs,
2932
RunE: func(cmd *cobra.Command, args []string) error {
3033

cmd/run.go

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,16 +209,24 @@ func newRunCmdFunc(e shipyard.Engine, bp clients.Getter, hc clients.HTTP, bc cli
209209
cmd.Println("")
210210

211211
if len(e.Blueprint().Environment) > 0 {
212-
cmd.Println("This blueprint defines the following environment varaibles:")
212+
cmd.Println("######################################################")
213+
cmd.Println("")
214+
cmd.Println("Environment Variables")
215+
cmd.Println("")
216+
cmd.Println("######################################################")
217+
218+
cmd.Println("")
219+
cmd.Println("This blueprint exports the following environment varaibles:")
213220
cmd.Println("")
214221
for _, env := range e.Blueprint().Environment {
215-
cmd.Printf("%s=%s\n", env.Key, env.Value)
222+
cmd.Printf("\033[1;32m%s=%s=\033[0m\n", env.Key, env.Value)
216223
}
217224
cmd.Println("")
218-
cmd.Println("You can set these using the following command:")
225+
cmd.Println("You can set exported environment variables for your current terminal session using the following command:")
226+
cmd.Println("")
219227

220228
if runtime.GOOS == "windows" {
221-
cmd.Println(`@FOR /f "tokens=*" %i IN ('minikube -p minikube docker-env') DO @%i`)
229+
cmd.Println(`@FOR /f "tokens=*" %i IN ('shipyard env') DO @%i`)
222230
} else {
223231
cmd.Println("eval $(shipyard env)")
224232
}

0 commit comments

Comments
 (0)