File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ## v0.0.4 (October 4, 2023)
2+ * Don't append default profile if it already exists.
3+
14## v0.0.3 (September 22, 2023)
25* Added additional error checking.
36
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ const (
1818 CyanColor = "\033 [0;36m%s\033 [0m"
1919)
2020
21- var version string = "v0.0.3 "
21+ var version string = "v0.0.4 "
2222
2323func newPromptUISearcher (items []string ) list.Searcher {
2424 return func (searchInput string , itemIndex int ) bool {
@@ -116,11 +116,20 @@ func getProfiles(profileFileLocation string) []string {
116116 log .Fatal (err )
117117 }
118118
119- profiles = append (profiles , "default" )
119+ profiles = appendIfNotExists (profiles , "default" )
120120 sort .Strings (profiles )
121121 return profiles
122122}
123123
124+ func appendIfNotExists (slice []string , s string ) []string {
125+ for _ , v := range slice {
126+ if v == s {
127+ return slice
128+ }
129+ }
130+ return append (slice , s )
131+ }
132+
124133func getenv (key , fallback string ) string {
125134 value := os .Getenv (key )
126135 if len (value ) == 0 {
You can’t perform that action at this time.
0 commit comments