Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Request]: Improve hab --site cli #24

Open
MHendricks opened this issue Jan 13, 2023 · 1 comment
Open

[Request]: Improve hab --site cli #24

MHendricks opened this issue Jan 13, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@MHendricks
Copy link
Member

Description

The hab --site ... cli call is useful for testing and to ensure a user runs a command with your development setup, but it is a little cumbersome having to pass --site for each path to include, and often you just want to prepend an argument to HAB_PATHS.

Solution

Add the ability to:

  • Specify multiple paths with a single --site call. hab --site "~/dev.json;~host.json" dump --type site
  • An easy way to append/prepend to the HAB_PATHS env var. hab --site "~/prepend.json;$HAB_PATHS;~/append.json" dump --type site

Additional Context

No response

@MHendricks MHendricks added the enhancement New feature or request label Jan 13, 2023
@MHendricks
Copy link
Member Author

We could possibly add a hab cfg or hab site command that would provide a unified way to set the HAB_PATHS env variable. Currently, you have to use the correct command for the shell the user is using.

cmd: set "HAB_PATHS=.../pre.json;%HAB_PATHS%;.../post.json"
powershell: $env:{key} = ".../pre.json;%HAB_PATHS%;.../post.json"
bash windows: export HAB_PATHS=".../pre.json;$HAB_PATHS;.../post.json".
bash linux: export HAB_PATHS=".../pre.json:$HAB_PATHS:.../post.json"

The hab activate command is able to modify env vars of the current shell, so we should be able to make the hab site command modify the HAB_PATHS env var. This command could work for all shells(Note unc paths will still require adding leading \\ for bash on windows.)

hab site".../dev.json" HAB_PATHS ".../post.json"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant