Skip to content

Commit

Permalink
add versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
sstark committed Nov 11, 2018
1 parent 52075b3 commit bebd996
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
2 changes: 2 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ func main() {
flag.BoolVar(&fNotify, "notify", notifyDefault, "send email notification when one time link is used")
flag.Parse()

log.Printf("gjfy version %s\n", version)

store := make(secretStore)
store.NewEntry("secret", 100, 0, "test@example.org", "test")
go store.Expiry(time.Minute * expiryCheck)
Expand Down
22 changes: 22 additions & 0 deletions tag-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/zsh

v="$1"
if [[ -z $v ]]
then
print "usage: $0 <version>"
exit 1
fi

if [[ $v == v* ]]
then
print "do not add the v prefix, tag should look like \"1.5\""
exit 1
fi

grep -q "version = \"$v\"" version.go
if [[ $? != 0 ]]
then
print "fix version.go first"
exit 1
fi
echo git tag -s v$v -m \"tag gjfy v$v\"
5 changes: 5 additions & 0 deletions version.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package main

var (
version = "1.1"
)

0 comments on commit bebd996

Please sign in to comment.