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

--binpath flag #1223

Merged
merged 1 commit into from
May 25, 2022
Merged
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
8 changes: 8 additions & 0 deletions cmd/skywire-cli/commands/config/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ var (
svcconf = strings.ReplaceAll(utilenv.ServiceConfAddr, "http://", "") //skyenv.DefaultServiceConfAddr
testconf = strings.ReplaceAll(utilenv.TestServiceConfAddr, "http://", "") //skyenv.DefaultServiceConfAddr
hiddenflags []string
binPath string
)

func init() {
Expand Down Expand Up @@ -112,6 +113,8 @@ func init() {
genConfigCmd.Flags().StringVar(&ver, "version", "", "custom version testing override")
hiddenflags = append(hiddenflags, "version")
genConfigCmd.Flags().BoolVar(&all, "all", false, "show all flags")
genConfigCmd.Flags().StringVar(&binPath, "binpath", "", "set bin_path")
hiddenflags = append(hiddenflags, "binpath")

for _, j := range hiddenflags {
genConfigCmd.Flags().MarkHidden(j) //nolint
Expand Down Expand Up @@ -372,6 +375,11 @@ var genConfigCmd = &cobra.Command{
conf.Hypervisor.EnableAuth = true
}
}
// check binpath argument and use if set
if binPath != "" {
conf.Launcher.BinPath = binPath
}

if ver != "" {
conf.Common.Version = ver
}
Expand Down