feat(init): allow passing specific shell to setup command (#25)
This commit is contained in:
+9
-3
@@ -97,8 +97,9 @@ func init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var setupCmd = &cobra.Command{
|
var setupCmd = &cobra.Command{
|
||||||
Use: "setup",
|
Use: "setup [shell]",
|
||||||
Short: "Automatically setup iris shell integration and install binary",
|
Short: "Automatically setup iris shell integration and install binary",
|
||||||
|
Args: cobra.MaximumNArgs(1),
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
home, _ := os.UserHomeDir()
|
home, _ := os.UserHomeDir()
|
||||||
|
|
||||||
@@ -122,8 +123,13 @@ var setupCmd = &cobra.Command{
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
shellPath := os.Getenv("SHELL")
|
var shellName string
|
||||||
shellName := filepath.Base(shellPath)
|
if len(args) > 0 {
|
||||||
|
shellName = args[0]
|
||||||
|
} else {
|
||||||
|
shellPath := os.Getenv("SHELL")
|
||||||
|
shellName = filepath.Base(shellPath)
|
||||||
|
}
|
||||||
var configFile string
|
var configFile string
|
||||||
var evalCmd string
|
var evalCmd string
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user