Skip to content

Commit

Permalink
remove hard coded version
Browse files Browse the repository at this point in the history
  • Loading branch information
DeeStarks committed Aug 12, 2022
1 parent 23d6efa commit 3d8f033
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 24 deletions.
22 changes: 1 addition & 21 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,8 @@ var (
rootCmd = &cobra.Command{
Use: "conoid",
Short: "Conoid is a reverse proxy server that can also expose your localhost on the internet",
Long: fmt.Sprintf("CONOID (%s)\nA reverse proxy server with load balancer and caching feature.\nIt also uses localtunnel to help you easily expose web services on your\nlocal development machine without messing with DNS and firewall settings", config.VERSION),
Long: "CONOID:\nA simple HTTP server that can be used to serve static files. \nIt also provides TCP tunnelling through localtunnel to bypass a firewall or NAT,\nwhich enables local development servers be exposed to the internet.",
Run: func(cmd *cobra.Command, args []string) {
// Print version
if v, _ := cmd.Flags().GetBool("version"); v {
fmt.Println(config.VERSION)
return
}

// Connect to the default db
defaultDB, err := sql.Open("sqlite3", config.DEFAULT_DB)
if err != nil {
Expand Down Expand Up @@ -81,22 +75,8 @@ var (
fmt.Println("Done!")
},
}

versionCmd = &cobra.Command{
Use: "version",
Short: "Current conoid version",
Long: `All software has versions. This is Conoid's`,
Run: func(cmd *cobra.Command, args []string) {
fmt.Println(config.VERSION)
},
}
)

func init() {
rootCmd.AddCommand(versionCmd)
rootCmd.Flags().BoolP("version", "v", false, "conoid version")
}

func Execute() {
rootCmd.Execute()
}
3 changes: 0 additions & 3 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ import (
)

const (
// App info
VERSION = "0.0.1"

// Network
TCP_PORT = 5000
MAX_CONN_COUNT = 100
Expand Down

0 comments on commit 3d8f033

Please sign in to comment.