Skip to content

Commit

Permalink
Merge pull request #538 from nanobox-io/bugfix/536
Browse files Browse the repository at this point in the history
Skip checks and just print the version
  • Loading branch information
glinton authored Aug 18, 2017
2 parents c2b2923 + e636932 commit 41a844a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
13 changes: 7 additions & 6 deletions commands/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,17 @@ import (

var (

// VersionCmd ...
// VersionCmd prints the nanobox version.
VersionCmd = &cobra.Command{
Use: "version",
Short: "Show the current Nanobox version.",
Long: ``,
Run: versionFn,
Use: "version",
Short: "Show the current Nanobox version.",
Long: ``,
PersistentPreRun: func(ccmd *cobra.Command, args []string) {},
Run: versionFn,
}
)

// versionFn ...
// versionFn does the actual printing
func versionFn(ccmd *cobra.Command, args []string) {
fmt.Println(models.VersionString())
}
11 changes: 9 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
// Package main ...
// Nanobox automates the creation of isolated, repeatable environments for local
// and production applications. When developing locally, Nanobox provisions your
// app's infrastructure inside of a virtual machine (VM) and mounts your local
// codebase into the VM. Any changes made to your codebase are reflected inside
// the virtual environment.
//
// Once code is built and tested locally, Nanobox provisions and deploys an
// identical infrastructure on a production platform.
package main

import (
Expand Down Expand Up @@ -47,7 +54,7 @@ func main() {

// if it is running the server just run it
// skip the tratiotional messaging
if len(os.Args) == 2 && os.Args[1] == "server" {
if len(os.Args) == 2 && (os.Args[1] == "server" || os.Args[1] == "version" || os.Args[1] == "tunnel" || os.Args[1] == "login" || os.Args[1] == "logout") {
err := commands.NanoboxCmd.Execute()
if err != nil {
fmt.Println(err)
Expand Down

0 comments on commit 41a844a

Please sign in to comment.