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

Allow destination and config-file in aliases #1032

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

djmb
Copy link
Collaborator

@djmb djmb commented Oct 2, 2024

We only loaded the configuration once, which meant that aliases always used the initial configuration file and destination.

We don't want to load the configuration in subcommands as it is not passed all the options we need. But just checking if we are in a subcommand is enough - the alias reloads and the subcommand does not.

One thing to note is that anything passed on the command line overrides what is in the alias, so if an alias says
other_config: config -c config/deploy2.yml and you run kamal other_config -c config/deploy.yml, it won't switch.

Fixes: #1027

We only loaded the configuration once, which meant that aliases always
used the initial configuration file and destination.

We don't want to load the configuration in subcommands as it is not
passed all the options we need. But just checking if we are in a
subcommand is enough - the alias reloads and the subcommand does not.

One thing to note is that anything passed on the command line overrides
what is in the alias, so if an alias says
`other_config: config -c config/deploy2.yml` and you run
`kamal other_config -c config/deploy.yml`, it won't switch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't override --config-file in aliases
1 participant