Compare commits

..

2 Commits

Author SHA1 Message Date
Luis Pater
d2394b0be9 Update .goreleaser.yml to specify archive formats for different OS targets
Some checks failed
docker-image / docker (push) Has been cancelled
goreleaser / goreleaser (push) Has been cancelled
- Added `tar.gz` as the default archive format.
- Introduced `zip` format override for Windows builds.
2025-08-08 14:28:02 +08:00
Luis Pater
ebcd4dbf3d Fix activation URL extraction logic and improve warning message formatting
Some checks failed
docker-image / docker (push) Has been cancelled
goreleaser / goreleaser (push) Has been cancelled
- Corrected JSON path for error code and activation URL extraction in client error handling.
- Improved readability of the activation warning message with better spacing.
2025-08-05 23:58:43 +08:00
2 changed files with 7 additions and 3 deletions

View File

@@ -11,6 +11,10 @@ builds:
binary: cli-proxy-api
archives:
- id: "cli-proxy-api"
format: tar.gz
format_overrides:
- goos: windows
format: zip
files:
- LICENSE
- README.md

View File

@@ -844,11 +844,11 @@ func (c *Client) CheckCloudAPIIsEnabled() (bool, error) {
if err.StatusCode == 403 {
errJSON := err.Error.Error()
// Check for a specific error code and extract the activation URL.
if gjson.Get(errJSON, "error.code").Int() == 403 {
activationURL := gjson.Get(errJSON, "error.details.0.metadata.activationUrl").String()
if gjson.Get(errJSON, "0.error.code").Int() == 403 {
activationURL := gjson.Get(errJSON, "0.error.details.0.metadata.activationUrl").String()
if activationURL != "" {
log.Warnf(
"\n\nPlease activate your account with this url:\n\n%s\n And execute this command again:\n%s --login --project_id %s",
"\n\nPlease activate your account with this url:\n\n%s\n\n And execute this command again:\n%s --login --project_id %s",
activationURL,
os.Args[0],
c.tokenStorage.ProjectID,