From a8cb9687fa9fe2e9516a1ab700eaff6ed4bbf8e2 Mon Sep 17 00:00:00 2001 From: MohammadReza Palide Date: Sat, 3 Feb 2024 13:24:40 +0330 Subject: [PATCH] remove keys-gen codes and Makefile related commands --- Makefile | 5 +-- cmd/keys-gen/commands/root.go | 70 -------------------------------- cmd/keys-gen/keys-gen.go | 10 ----- cmd/skywire-services/services.go | 2 - 4 files changed, 1 insertion(+), 86 deletions(-) delete mode 100644 cmd/keys-gen/commands/root.go delete mode 100644 cmd/keys-gen/keys-gen.go diff --git a/Makefile b/Makefile index 4ce2498f..387488e9 100644 --- a/Makefile +++ b/Makefile @@ -63,7 +63,6 @@ build: dep ## Build binaries ${OPTS} go build ${BUILD_OPTS} -o ./bin/transport-discovery ./cmd/transport-discovery ${OPTS} go build ${BUILD_OPTS} -o ./bin/address-resolver ./cmd/address-resolver ${OPTS} go build ${BUILD_OPTS} -o ./bin/sw-env ./cmd/sw-env - ${OPTS} go build ${BUILD_OPTS} -o ./bin/keys-gen ./cmd/keys-gen ${OPTS} go build ${BUILD_OPTS} -o ./bin/network-monitor ./cmd/network-monitor ${OPTS} go build ${BUILD_OPTS} -o ./apps/vpn-client ./cmd/vpn-lite-client ${OPTS} go build ${BUILD_OPTS} -o ./bin/transport-setup ./cmd/transport-setup @@ -102,7 +101,6 @@ build-race: dep ## Build binaries ${OPTS} go build ${BUILD_OPTS} -race -o ./bin/transport-discovery ./cmd/transport-discovery ${OPTS} go build ${BUILD_OPTS} -race -o ./bin/address-resolver ./cmd/address-resolver ${OPTS} go build ${BUILD_OPTS} -race -o ./bin/sw-env ./cmd/sw-env - ${OPTS} go build ${BUILD_OPTS} -race -o ./bin/keys-gen ./cmd/keys-gen ${OPTS} go build ${BUILD_OPTS} -race -o ./bin/network-monitor ./cmd/network-monitor ${OPTS} go build ${BUILD_OPTS} -race -o ./bin/vpn-client ./cmd/vpn-lite-client ${OPTS} go build ${BUILD_OPTS} -race -o ./bin/transport-setup ./cmd/transport-setup @@ -114,13 +112,12 @@ build-race: dep ## Build binaries ${OPTS} go build ${BUILD_OPTS} -race -o ./bin/skysocks-client ./cmd/skysocks-lite-client ${OPTS} go build ${BUILD_OPTS} -race -o ./bin/public-visor-monitor ./cmd/public-visor-monitor -install: ## Install route-finder, transport-discovery, address-resolver, sw-env, keys-gen, network-monitor, node-visualizer +install: ## Install route-finder, transport-discovery, address-resolver, sw-env, network-monitor, node-visualizer ${OPTS} go install ${BUILD_OPTS} \ ./cmd/route-finder \ ./cmd/transport-discovery \ ./cmd/address-resolver \ ./cmd/sw-env \ - ./cmd/keys-gen \ ./cmd/network-monitor \ ./cmd/node-visualizer diff --git a/cmd/keys-gen/commands/root.go b/cmd/keys-gen/commands/root.go deleted file mode 100644 index 84c54c77..00000000 --- a/cmd/keys-gen/commands/root.go +++ /dev/null @@ -1,70 +0,0 @@ -// Package commands cmd/keys-gen/commands/root.go -package commands - -import ( - "fmt" - "log" - - cc "github.com/ivanpirog/coloredcobra" - "github.com/skycoin/skywire-utilities/pkg/buildinfo" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/spf13/cobra" -) - -func init() { - var helpflag bool - RootCmd.SetUsageTemplate(help) - RootCmd.PersistentFlags().BoolVarP(&helpflag, "help", "h", false, "help for keys-gen") - RootCmd.SetHelpCommand(&cobra.Command{Hidden: true}) - RootCmd.PersistentFlags().MarkHidden("help") //nolint -} - -// RootCmd contains the root command -var RootCmd = &cobra.Command{ - Use: "kg", - Short: "skywire keys generator, prints pub-key and sec-key", - Long: ` - ┬┌─┌─┐┬ ┬┌─┐ ┌─┐┌─┐┌┐┌ - ├┴┐├┤ └┬┘└─┐───│ ┬├┤ │││ - ┴ ┴└─┘ ┴ └─┘ └─┘└─┘┘└┘`, - SilenceErrors: true, - SilenceUsage: true, - DisableSuggestions: true, - DisableFlagsInUseLine: true, - Version: buildinfo.Version(), - Run: func(_ *cobra.Command, _ []string) { - pk, sk := cipher.GenerateKeyPair() - fmt.Println(pk) - fmt.Println(sk) - }, -} - -// Execute executes root CLI command -func Execute() { - cc.Init(&cc.Config{ - RootCmd: RootCmd, - Headings: cc.HiBlue + cc.Bold, //+ cc.Underline, - Commands: cc.HiBlue + cc.Bold, - CmdShortDescr: cc.HiBlue, - Example: cc.HiBlue + cc.Italic, - ExecName: cc.HiBlue + cc.Bold, - Flags: cc.HiBlue + cc.Bold, - //FlagsDataType: cc.HiBlue, - FlagsDescr: cc.HiBlue, - NoExtraNewlines: true, - NoBottomNewline: true, - }) - if err := RootCmd.Execute(); err != nil { - log.Fatal("Failed to execute command: ", err) - } -} - -const help = "Usage:\r\n" + - " {{.UseLine}}{{if .HasAvailableSubCommands}}{{end}} {{if gt (len .Aliases) 0}}\r\n\r\n" + - "{{.NameAndAliases}}{{end}}{{if .HasAvailableSubCommands}}\r\n\r\n" + - "Available Commands:{{range .Commands}}{{if (or .IsAvailableCommand)}}\r\n " + - "{{rpad .Name .NamePadding }} {{.Short}}{{end}}{{end}}{{end}}{{if .HasAvailableLocalFlags}}\r\n\r\n" + - "Flags:\r\n" + - "{{.LocalFlags.FlagUsages | trimTrailingWhitespaces}}{{end}}{{if .HasAvailableInheritedFlags}}\r\n\r\n" + - "Global Flags:\r\n" + - "{{.InheritedFlags.FlagUsages | trimTrailingWhitespaces}}{{end}}\r\n\r\n" diff --git a/cmd/keys-gen/keys-gen.go b/cmd/keys-gen/keys-gen.go deleted file mode 100644 index ce84ce7e..00000000 --- a/cmd/keys-gen/keys-gen.go +++ /dev/null @@ -1,10 +0,0 @@ -// Package main cmd/keys-gen/keys-gen.go -package main - -import ( - "github.com/skycoin/skywire-services/cmd/keys-gen/commands" -) - -func main() { - commands.Execute() -} diff --git a/cmd/skywire-services/services.go b/cmd/skywire-services/services.go index dc0f15d1..3e7082db 100644 --- a/cmd/skywire-services/services.go +++ b/cmd/skywire-services/services.go @@ -11,7 +11,6 @@ import ( ar "github.com/skycoin/skywire-services/cmd/address-resolver/commands" confbs "github.com/skycoin/skywire-services/cmd/config-bootstrapper/commands" dmsgm "github.com/skycoin/skywire-services/cmd/dmsg-monitor/commands" - kg "github.com/skycoin/skywire-services/cmd/keys-gen/commands" lc "github.com/skycoin/skywire-services/cmd/liveness-checker/commands" nv "github.com/skycoin/skywire-services/cmd/node-visualizer/commands" pvm "github.com/skycoin/skywire-services/cmd/public-visor-monitor/commands" @@ -30,7 +29,6 @@ func init() { ar.RootCmd, rf.RootCmd, confbs.RootCmd, - kg.RootCmd, lc.RootCmd, nv.RootCmd, pvm.RootCmd,