Skip to content

Commit 73ce9d0

Browse files
committed
refactor: rename shell constants
1 parent 8f3011e commit 73ce9d0

4 files changed

Lines changed: 10 additions & 10 deletions

File tree

cmd/config/set/set.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func RunConfigSetCmd(appFs afero.Fs, args []string) error {
5151
case "EditorCmd":
5252
c.EditorCmd = value
5353
case "Shell":
54-
if value != pkg.Shell_Bash && value != pkg.Shell_Zsh && value != pkg.Shell_Fish {
54+
if value != pkg.BashShell && value != pkg.ZshShell && value != pkg.FishShell {
5555
return fmt.Errorf("Shell must be either Bash, Zsh, or Fish. Received: %s", value)
5656
}
5757

cmd/install/install.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ func RunInstallCmd(appFs afero.Fs) error {
5858

5959
if shell == "" {
6060
options := []huh.Option[string]{
61-
huh.NewOption("Bash", pkg.Shell_Bash),
62-
huh.NewOption("Zsh", pkg.Shell_Zsh),
63-
huh.NewOption("Fish", pkg.Shell_Fish),
61+
huh.NewOption("Bash", pkg.BashShell),
62+
huh.NewOption("Zsh", pkg.ZshShell),
63+
huh.NewOption("Fish", pkg.FishShell),
6464
}
6565
shellString, shellErr := ui.Select("What shell do you use?", options)
6666

cmd/make/make.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,11 @@ func sourceAliasFile(appFs afero.Fs, config pkg.Config) error {
9393
}
9494

9595
switch config.Shell {
96-
case pkg.Shell_Bash:
96+
case pkg.BashShell:
9797
return sourceBashFile(appFs, home)
98-
case pkg.Shell_Zsh:
98+
case pkg.ZshShell:
9999
return sourceZshFile(appFs, home)
100-
case pkg.Shell_Fish:
100+
case pkg.FishShell:
101101
return sourceFishFile(appFs, home)
102102
}
103103

pkg/constants.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package pkg
22

33
const (
4-
Shell_Bash = "Bash"
5-
Shell_Zsh = "Zsh"
6-
Shell_Fish = "Fish"
4+
BashShell = "Bash"
5+
ZshShell = "Zsh"
6+
FishShell = "Fish"
77
)

0 commit comments

Comments
 (0)