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

Improve Shell Default Arguments #152

Merged
merged 1 commit into from
Sep 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -304,27 +304,27 @@ Please see [this comment for now](https://github.com/mamba-org/provision-with-mi

## About login shells...

Some shells require special syntax (e.g. `bash -l {0}`). You can set this up with the `defaults` option:
Some shells require special syntax (e.g. `bash -leo pipefail {0}`). You can set this up with the `defaults` option:

```yaml
jobs:
myjob:
defaults:
run:
shell: bash -l {0}
shell: bash -leo pipefail {0} {0}

# or top-level:
defaults:
run:
shell: bash -l {0}
shell: bash -leo pipefail {0} {0}
jobs:
...
```

Find the reasons below (taken from [setup-miniconda](https://github.com/conda-incubator/setup-miniconda/blob/master/README.md#important)):

- Bash shells do not use `~/.profile` or `~/.bashrc` so these shells need to be
explicitly declared as `shell: bash -l {0}` on steps that need to be properly
explicitly declared as `shell: bash -leo pipefail {0}` on steps that need to be properly
activated (or use a default shell). This is because bash shells are executed
with `bash --noprofile --norc -eo pipefail {0}` thus ignoring updated on bash
profile files made by `micromamba shell init bash`.
Expand Down