Skip to content

Commit

Permalink
Add version command
Browse files Browse the repository at this point in the history
  • Loading branch information
frozzare committed Aug 16, 2018
1 parent 0353045 commit cd6336b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
test
dist
1 change: 1 addition & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
build:
main: main.go
binary: create-project
ldflags: -s -w -X main.version={{.Version}}
goos:
- darwin
- linux
Expand Down
11 changes: 11 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,28 @@ package main
import (
"log"
"os"
"strings"

"github.com/frozzare/create-project/project"
)

var version = "master"

func main() {
log.SetFlags(0)
log.SetOutput(os.Stderr)

if len(os.Args) < 2 {
log.Fatal("No source url or directory")
}

src := os.Args[1]

if strings.ToLower(src) == "version" {
log.Printf("create-project version %s\n", version)
return
}

path, err := os.Getwd()
if err != nil {
log.Fatal(err)
Expand Down

0 comments on commit cd6336b

Please sign in to comment.