Skip to content

Commit

Permalink
latest version release
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Jeannopoulos committed Aug 31, 2020
1 parent 0278c5d commit 00f67af
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ build_release:
BIN_EXTENSION=$(BIN_EXTENSION) GOOS=$(GOOS) GOARCH=$(GOARCH) go build -o $(RELEASE_DIR)/$(BIN_NAME)-$(GOOS)-$(GOARCH)$(BIN_EXTENSION) -a -ldflags '$(COMPILE_LDFLAGS)' $(APP_PATH)


release_artifacts: ## build_info ## build release binaries into release dir
release_artifacts: ## build_info fmt check ## build release binaries into release dir
@rm -rf $(RELEASE_DIR)
@mkdir -p $(RELEASE_DIR)
@echo "build release artifacts"
Expand Down
4 changes: 2 additions & 2 deletions cmd/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func registerOrGetDeviceInfo() {

fmt.Printf("\nLoaded %d auth tokens from authy server\n\n", len(tokens))
for _, v := range tokens {
fmt.Printf("Token: %s\n", v.Name)
}
fmt.Printf("Token: %s\n", v.Name)
}

}
16 changes: 4 additions & 12 deletions cmd/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,17 @@ import (
"strings"
"time"
)

const (
configFileName = ".authy.json"
cacheFileName = ".authycache.json"
cacheFileName = ".authycache.json"
)



var verbose bool

var (
// Version version tag
Version = "v0.1"
// BuildDate date string of when build was performed filled in by -X compile flag
BuildDate string

Expand All @@ -60,7 +61,6 @@ var (
RuntimeVer string
)


// DeviceRegistration authy account details
type DeviceRegistration struct {
UserID uint64 `json:"user_id,omitempty"`
Expand All @@ -70,7 +70,6 @@ type DeviceRegistration struct {
MainPassword string `json:"main_password,omitempty"`
}


// Token save in cache
type Token struct {
Name string `json:"name"`
Expand Down Expand Up @@ -186,8 +185,6 @@ func getTokensFromAuthyServer(devInfo *DeviceRegistration) (tks []*Token, err er
fmt.Printf("AuthenticatorTokens: %v\n", v.Name)
}



tks = append(tks, &Token{
Name: v.Name,
OriginalName: v.OriginalName,
Expand Down Expand Up @@ -264,9 +261,6 @@ func (tk *Token) GetTotpCode() (string, int) {
return code, secsLeft
}




// SaveDeviceInfo ..
func SaveDeviceInfo(devInfo DeviceRegistration) (err error) {
regrPath, err := ConfigPath(configFileName)
Expand Down Expand Up @@ -321,8 +315,6 @@ func ConfigPath(fname string) (string, error) {
return filepath.Join(devPath, fname), nil
}



func newRegistrationDevice() (devInfo DeviceRegistration, err error) {
var (
sc = bufio.NewScanner(os.Stdin)
Expand Down
3 changes: 2 additions & 1 deletion cmd/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,13 @@ var infoCmd = &cobra.Command{

fmt.Printf(
`Application build information
Version : %s
Build date : %s
Build number : %s
Git commit : %s
Runtime version : %s
Built on OS : %s
`, BuildDate, BuildNumber, LatestCommit, RuntimeVer, BuiltOnOs)
`, Version, BuildDate, BuildNumber, LatestCommit, RuntimeVer, BuiltOnOs)
},
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ var cfgFile string
// rootCmd represents the base command when called without any subcommands
var rootCmd = &cobra.Command{
Use: "authy",
Short: "Authy command line too",
Short: "Authy command line tool",
Long: `Authy command line tool`,

// Uncomment the following line if your bare application
Expand Down
4 changes: 4 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ import (
)

var (
// Version version tag
Version = "v0.1"

// BuildDate date string of when build was performed filled in by -X compile flag
BuildDate string

Expand All @@ -40,6 +43,7 @@ var (
)

func main() {
cmd.Version = Version
cmd.BuildDate = BuildDate
cmd.LatestCommit = LatestCommit
cmd.BuildNumber = BuildNumber
Expand Down

0 comments on commit 00f67af

Please sign in to comment.