Skip to content

Conversation

@msvticket
Copy link
Member

@msvticket msvticket commented Oct 28, 2025

appending an environment variable doesn't do anything if it is already set

The problem

If the BINARY_NAME environment variable happens to be set the help text are messed up:

$ BINARY_NAME=foo jx project --help
Create a new project by importing code, creating a quickstart or custom wizard for spring.

Usage:
  foo [flags]
  foo [command]

Examples:
  # Create a project using the wizard
  foo
---

As compared to the correct:

jx project --help
Create a new project by importing code, creating a quickstart or custom wizard for spring.

Usage:
  jx project [flags]
  jx project [command]

Examples:
  # Create a project using the wizard
  jx project

This PR fixes that:

BINARY_NAME=foo ./build/jx project --help
Create a new project by importing code, creating a quickstart or custom wizard for spring.

Usage:
  ./build/jx project [flags]
  ./build/jx project [command]

Examples:
  # Create a project using the wizard
  ./build/jx project
---

TOP_LEVEL_COMMAND has basically the same function as BINARY_NAME; some plugins use one and some the other.

appending an environment variable doesn't do anythinh if it is already set

Signed-off-by: Mårten Svantesson <[email protected]>
@msvticket
Copy link
Member Author

/cc tomhobson JordanGoasdoue Skisocks mentlak0

@msvticket
Copy link
Member Author

/retest

@codecov
Copy link

codecov bot commented Oct 28, 2025

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 32.11%. Comparing base (174064f) to head (0301b8c).
⚠️ Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
pkg/cmd/root.go 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8898      +/-   ##
==========================================
+ Coverage   32.08%   32.11%   +0.02%     
==========================================
  Files          10       10              
  Lines        1175     1174       -1     
==========================================
  Hits          377      377              
+ Misses        755      754       -1     
  Partials       43       43              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jenkins-x-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Skisocks

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@jenkins-x-bot jenkins-x-bot merged commit 774d9ca into main Nov 12, 2025
10 of 11 checks passed
@jenkins-x-bot jenkins-x-bot deleted the overwrite-env branch November 12, 2025 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants