Skip to content
This repository was archived by the owner on Feb 27, 2018. It is now read-only.

Commit 17e0cec

Browse files
committed
Merge pull request #366 from lalyos/add-checkEnvironment-into-shellinit
Add checkEnvironment call into cmdHellInit before printExport.
2 parents cb2c3bc + bcd1a9d commit 17e0cec

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

cmds.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,13 @@ func cmdShellInit() error {
176176
// These errors are not fatal
177177
fmt.Fprintf(os.Stderr, "Warning: error copying certificates: %s\n", err)
178178
}
179-
printExport(socket, certPath)
179+
180+
// Check if $DOCKER_* ENV vars are properly configured.
181+
if !checkEnvironment(socket, certPath) {
182+
printExport(socket, certPath)
183+
} else {
184+
fmt.Fprintf(os.Stderr, "Your environment variables are already set correctly.\n")
185+
}
180186

181187
return nil
182188
}

0 commit comments

Comments
 (0)