Skip to content

Commit

Permalink
chore: rename v3 version binary to enapter3
Browse files Browse the repository at this point in the history
  • Loading branch information
kulti committed Nov 11, 2024
1 parent 5ab985f commit b456abc
Show file tree
Hide file tree
Showing 14 changed files with 29 additions and 31 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.vscode
^enapter$
^enapter3$
dist
.DS_Store
.DS_Store
6 changes: 3 additions & 3 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: 2
project_name: enapter-cli

builds:
- binary: enapter
- binary: enapter3
main: ./cmd/enapter/
ldflags: -s -w -X main.version={{.Version}} -X main.commit={{.ShortCommit}} -X main.date={{.Date}}
env:
Expand Down Expand Up @@ -54,6 +54,6 @@ brews:
description: Command-line tool for Enapter Energy Management System Toolkit

install: |
bin.install "enapter"
bin.install "enapter3"
test: |
assert_match "Enapter CLI #{version}", shell_output("#{bin}/enapter --version")
assert_match "Enapter CLI #{version}", shell_output("#{bin}/enapter3 --version")
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ This tool helps Enapter customers to work with devices. It useful in the followi
brew tap enapter/tap && brew install enapter@3
```

If you already have installed previous version you probably need to update symblink as brew suggested you after install new version.

### Get prebuilt binaries

Choose your platform and required release on the [Releases page](https://github.com/Enapter/enapter-cli/releases).
Expand Down Expand Up @@ -46,10 +44,10 @@ Enapter CLI requires access token for authentication. Obtaining of the token is
4. Follow the instructions on the screen
<img src="./.assets/token.png">

5. Set environment variable `ENAPTER_API_TOKEN` with new token. To make it permanent don't forget to add it to configuration files of your shell.
5. Set environment variable `ENAPTER3_API_TOKEN` with new token. To make it permanent don't forget to add it to configuration files of your shell.

```bash
export ENAPTER_API_TOKEN="your token"
export ENAPTER3_API_TOKEN="your token"
```

Please note that if you don't save your token, it is not possible to reveal it anymore. You need generate new token.
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -ex

output=${1:-enapter}
output=${1:-enapter3}

BUILD_VERSION=$(git describe --tag 2> /dev/null)
BUILD_COMMIT=$(git rev-parse --short HEAD)
Expand Down
8 changes: 4 additions & 4 deletions internal/app/enaptercli/cmd_base.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ func (c *cmdBase) Flags() []cli.Flag {
&cli.StringFlag{
Name: "token",
Usage: "Enapter API token",
EnvVars: []string{"ENAPTER_API_TOKEN"},
EnvVars: []string{"ENAPTER3_API_TOKEN"},
Hidden: true,
Destination: &c.token,
Category: "HTTP API Configuration:",
},
&cli.StringFlag{
Name: "api-host",
Usage: "Override API endpoint",
EnvVars: []string{"ENAPTER_API_HOST"},
EnvVars: []string{"ENAPTER3_API_HOST"},
Hidden: true,
Value: "https://api.enapter.com",
Destination: &c.apiHost,
Expand All @@ -58,8 +58,8 @@ func (c *cmdBase) Before(cliCtx *cli.Context) error {
func (c *cmdBase) HelpTemplate() string {
return cli.CommandHelpTemplate + `
ENVIRONMENT VARIABLES:
ENAPTER_API_TOKEN Enapter API access token
ENAPTER_API_HOST Enapter API base URL (https://api.enapter.com by default)
ENAPTER3_API_TOKEN Enapter API access token
ENAPTER3_API_HOST Enapter API base URL (https://api.enapter.com by default)
`
}
Expand Down
2 changes: 1 addition & 1 deletion internal/app/enaptercli/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import "errors"

var (
errAPITokenMissed = errors.New("API token missing. Set it up using environment " +
"variable ENAPTER_API_TOKEN")
"variable ENAPTER3_API_TOKEN")
errBlueprintIDMissed = errors.New("blueprint ID is missed")
errBlueprintPathMissed = errors.New("blueprint path is missed")
errUnsupportedFlagValue = errors.New("unsupported flag value")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ OPTIONS:
--help, -h show help

ENVIRONMENT VARIABLES:
ENAPTER_API_TOKEN Enapter API access token
ENAPTER_API_HOST Enapter API base URL (https://api.enapter.com by default)
ENAPTER3_API_TOKEN Enapter API access token
ENAPTER3_API_HOST Enapter API base URL (https://api.enapter.com by default)

Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ OPTIONS:
--help, -h show help

ENVIRONMENT VARIABLES:
ENAPTER_API_TOKEN Enapter API access token
ENAPTER_API_HOST Enapter API base URL (https://api.enapter.com by default)
ENAPTER3_API_TOKEN Enapter API access token
ENAPTER3_API_HOST Enapter API base URL (https://api.enapter.com by default)

Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ OPTIONS:
--help, -h show help

ENVIRONMENT VARIABLES:
ENAPTER_API_TOKEN Enapter API access token
ENAPTER_API_HOST Enapter API base URL (https://api.enapter.com by default)
ENAPTER3_API_TOKEN Enapter API access token
ENAPTER3_API_HOST Enapter API base URL (https://api.enapter.com by default)

Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ OPTIONS:
--help, -h show help

ENVIRONMENT VARIABLES:
ENAPTER_API_TOKEN Enapter API access token
ENAPTER_API_HOST Enapter API base URL (https://api.enapter.com by default)
ENAPTER3_API_TOKEN Enapter API access token
ENAPTER3_API_HOST Enapter API base URL (https://api.enapter.com by default)

4 changes: 2 additions & 2 deletions internal/app/enaptercli/testdata/helps/enapter devices logs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ OPTIONS:
--help, -h show help

ENVIRONMENT VARIABLES:
ENAPTER_API_TOKEN Enapter API access token
ENAPTER_API_HOST Enapter API base URL (https://api.enapter.com by default)
ENAPTER3_API_TOKEN Enapter API access token
ENAPTER3_API_HOST Enapter API base URL (https://api.enapter.com by default)

4 changes: 2 additions & 2 deletions internal/app/enaptercli/testdata/helps/enapter devices logsf
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ OPTIONS:
--help, -h show help

ENVIRONMENT VARIABLES:
ENAPTER_API_TOKEN Enapter API access token
ENAPTER_API_HOST Enapter API base URL (https://api.enapter.com by default)
ENAPTER3_API_TOKEN Enapter API access token
ENAPTER3_API_HOST Enapter API base URL (https://api.enapter.com by default)

Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ OPTIONS:
--help, -h show help

ENVIRONMENT VARIABLES:
ENAPTER_API_TOKEN Enapter API access token
ENAPTER_API_HOST Enapter API base URL (https://api.enapter.com by default)
ENAPTER3_API_TOKEN Enapter API access token
ENAPTER3_API_HOST Enapter API base URL (https://api.enapter.com by default)

Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ OPTIONS:
--help, -h show help

ENVIRONMENT VARIABLES:
ENAPTER_API_TOKEN Enapter API access token
ENAPTER_API_HOST Enapter API base URL (https://api.enapter.com by default)
ENAPTER3_API_TOKEN Enapter API access token
ENAPTER3_API_HOST Enapter API base URL (https://api.enapter.com by default)

0 comments on commit b456abc

Please sign in to comment.