This repository has been archived by the owner on Jun 9, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dc24b4d
commit 9a0e23e
Showing
4 changed files
with
32 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package helpers | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/martinnirtl/dockma/internal/config" | ||
"github.com/martinnirtl/dockma/internal/survey" | ||
"github.com/ttacon/chalk" | ||
) | ||
|
||
// GetEnvironment returns one environment | ||
func GetEnvironment(env string) string { | ||
envs := config.GetEnvNames() | ||
|
||
for _, envName := range envs { | ||
if env == envName { | ||
return env | ||
} | ||
} | ||
|
||
fmt.Printf("%sNo such environment: %s%s\n", chalk.Yellow, env, chalk.ResetColor) | ||
|
||
env = survey.Select("Choose an environment", envs) | ||
|
||
return env | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters