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

Make profile args take precedence over env #825

Merged
merged 3 commits into from
Oct 25, 2023
Merged

Conversation

szymmis
Copy link
Contributor

@szymmis szymmis commented Oct 25, 2023

Fixes #823

@szymmis szymmis requested a review from mkaput as a code owner October 25, 2023 06:33
Copy link
Member

@mkaput mkaput left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if it wouldn't be better to allow multiple arguments in ProfileSpec group and employ overriding logic (--dev takes over --release which takes over --profile). Because we essentialy also have this problem if the user sets export SCARB_PROFILE=... in their .rc file etc.

scarb/src/bin/scarb/args.rs Outdated Show resolved Hide resolved
@szymmis szymmis force-pushed the szymmis/run-scripts-profile branch from f3cfe3a to fde42f2 Compare October 25, 2023 10:00
@szymmis szymmis requested review from maciektr and mkaput October 25, 2023 10:24
@szymmis szymmis force-pushed the szymmis/run-scripts-profile branch from fde42f2 to 4d6b1ed Compare October 25, 2023 10:25
Copy link
Member

@mkaput mkaput left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏🏻

@szymmis szymmis force-pushed the szymmis/run-scripts-profile branch from 4d6b1ed to b6f8a5f Compare October 25, 2023 11:10
@szymmis szymmis enabled auto-merge October 25, 2023 11:10
@szymmis szymmis added this pull request to the merge queue Oct 25, 2023
Merged via the queue into main with commit 42e1834 Oct 25, 2023
@szymmis szymmis deleted the szymmis/run-scripts-profile branch October 25, 2023 11:30
mkaput pushed a commit that referenced this pull request Oct 30, 2023
github-merge-queue bot pushed a commit that referenced this pull request Nov 6, 2023
Fixes #849
Removing a test when it's failing isn't a good idea but
`cannot_choose_both_release_and_dev` test that created from
`cannot_choose_both_release_and_by_name` (in #825) is a duplicate of
`cannot_choose_both_dev_and_release` test.

It could be fixed by adjusting stderr message assertion to 
```sh
Usage: scarb[..] --dev --global-cache-dir <DIRECTORY> --global-config-dir <DIRECTORY> <COMMAND>
```

but that would be the exact same thing as
`cannot_choose_both_dev_and_release`.
tomek0123456789 pushed a commit that referenced this pull request Nov 8, 2023
Fixes #849
Removing a test when it's failing isn't a good idea but
`cannot_choose_both_release_and_dev` test that created from
`cannot_choose_both_release_and_by_name` (in #825) is a duplicate of
`cannot_choose_both_dev_and_release` test.

It could be fixed by adjusting stderr message assertion to 
```sh
Usage: scarb[..] --dev --global-cache-dir <DIRECTORY> --global-config-dir <DIRECTORY> <COMMAND>
```

but that would be the exact same thing as
`cannot_choose_both_dev_and_release`.
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.

Cannot use --dev and --release flags in run scripts
3 participants