Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add shell option #107

Merged
merged 2 commits into from
Jan 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion cmd/qpm/internal/cmd/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (

func init() {
var aquiferPath string
var shell string

installCmd := &cobra.Command{
Use: "install",
Expand Down Expand Up @@ -55,11 +56,15 @@ func init() {
}
}

return qpm.Execute(c, s, qpm.Install, bufio.NewWriter(os.Stdout), bufio.NewWriter(os.Stderr))
cfg := c
cfg.Shell = []string{shell}

return qpm.Execute(cfg, s, qpm.Install, bufio.NewWriter(os.Stdout), bufio.NewWriter(os.Stderr))
},
}

installCmd.PersistentFlags().StringVarP(&aquiferPath, "aquifer", "a", "", "Aquifer directory path")
installCmd.PersistentFlags().StringVarP(&shell, "shell", "s", "", "Shell")
rootCmd.AddCommand(installCmd)
}

Expand Down
7 changes: 6 additions & 1 deletion cmd/qpm/internal/cmd/uninstall.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (

func init() {
var aquiferPath string
var shell string

uninstallCmd := &cobra.Command{
Use: "uninstall",
Expand Down Expand Up @@ -38,10 +39,14 @@ func init() {
return err
}

return qpm.Execute(c, s, qpm.Uninstall, bufio.NewWriter(os.Stdout), bufio.NewWriter(os.Stderr))
cfg := c
cfg.Shell = []string{shell}

return qpm.Execute(cfg, s, qpm.Uninstall, bufio.NewWriter(os.Stdout), bufio.NewWriter(os.Stderr))
},
}

uninstallCmd.PersistentFlags().StringVarP(&aquiferPath, "aquifer", "a", "", "Aquifer directory path")
uninstallCmd.PersistentFlags().StringVarP(&shell, "shell", "s", "", "Shell")
rootCmd.AddCommand(uninstallCmd)
}
6 changes: 1 addition & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ go 1.19

require (
github.com/AlecAivazis/survey/v2 v2.3.7
github.com/fatih/color v1.15.0
github.com/go-git/go-git/v5 v5.11.0
github.com/goccy/go-yaml v1.11.2
github.com/google/go-cmp v0.6.0
Expand All @@ -16,28 +17,23 @@ require (
dario.cat/mergo v1.0.0 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 // indirect
github.com/acomagu/bufpipe v1.0.4 // indirect
github.com/cloudflare/circl v1.3.3 // indirect
github.com/cyphar/filepath-securejoin v0.2.4 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
github.com/fatih/color v1.15.0 // indirect
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
github.com/go-git/go-billy/v5 v5.5.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/imdario/mergo v0.3.15 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
github.com/kevinburke/ssh_config v1.2.0 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b // indirect
github.com/pjbgf/sha1cd v0.3.0 // indirect
github.com/sergi/go-diff v1.1.0 // indirect
github.com/skeema/knownhosts v1.2.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/stretchr/testify v1.8.4 // indirect
github.com/xanzy/ssh-agent v0.3.3 // indirect
golang.org/x/crypto v0.16.0 // indirect
golang.org/x/mod v0.14.0 // indirect
Expand Down
Loading