Skip to content

Commit e2f9500

Browse files
committed
added build and version
1 parent 26653ee commit e2f9500

File tree

5 files changed

+43
-2
lines changed

5 files changed

+43
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
*.bin
22
out
3+
build

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,32 @@ To install from source clone the project and run
1414
```bash
1515
go install ./...
1616
```
17+
18+
## Usage
19+
20+
To download a TEK export run `gaen download` with a supported app (`immuni` or `swisscovid`, at the moment):
21+
22+
```
23+
gaen download immuni
24+
```
25+
26+
This will download the export in a `out/immuni/xxx` folder.
27+
28+
Then you can decode the export running
29+
30+
```
31+
gaen decode out/immuni/xxx/export.bin
32+
```
33+
34+
and this will output the first TEK with the first RPI:
35+
36+
```
37+
TEK: [+KYwhAsB9QEq0PvaJfo4+Q==] - [F8 A6 30 84 B 1 F5 1 2A D0 FB DA 25 FA 38 F9]
38+
39+
RPI:
40+
{
41+
"id": "q7WZAsXPgkuE+BEiadwLPQ==",
42+
"id_bytes": "AB B5 99 2 C5 CF 82 4B 84 F8 11 22 69 DC B 3D",
43+
"interval": "2020-10-03T02:00:00+02:00"
44+
}
45+
```

build.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
VERSION=$(git describe --tags)
4+
ARCH=amd64
5+
6+
for OS in linux darwin windows;
7+
do
8+
GOARCH=${ARCH} GOOS=${OS} go build -ldflags "-X main.version=${VERSION}" -o build/gaen-${VERSION}-${OS}-${ARCH} .
9+
done

go.sum

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgf
5757
github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
5858
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
5959
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
60+
github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=
6061
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
6162
github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
6263
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=

main.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@ import (
66
"fmt"
77
"gaen/export"
88
"io/ioutil"
9-
"strings"
109

1110
"github.com/spf13/cobra"
1211
"google.golang.org/protobuf/proto"
1312
)
1413

14+
var version = "0.0.0-dev"
15+
1516
var rootCmd = &cobra.Command{
1617
Use: "gaen",
1718
Short: "gaen is a cli to interact with the Google Apple Exposure Notification",
@@ -21,7 +22,7 @@ var versionCmd = &cobra.Command{
2122
Use: "version",
2223
Short: "Print the gaen version number",
2324
Run: func(cmd *cobra.Command, args []string) {
24-
fmt.Println("Print: " + strings.Join(args, " "))
25+
fmt.Println("gaen version " + version)
2526
},
2627
}
2728

0 commit comments

Comments
 (0)