Skip to content
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
27 changes: 25 additions & 2 deletions src/artifacts-helper/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Configures Codespace to authenticate with Azure Artifact feeds

```json
"features": {
"ghcr.io/microsoft/codespace-features/artifacts-helper:1": {}
"ghcr.io/microsoft/codespace-features/artifacts-helper:2": {}
}
```

Expand All @@ -23,8 +23,8 @@ Configures Codespace to authenticate with Azure Artifact feeds
| yarnAlias | Create alias for yarn | boolean | true |
| npxAlias | Create alias for npx | boolean | true |
| rushAlias | Create alias for rush | boolean | true |
| targetFiles | Comma separated list of files to write to. Default is '/etc/bash.bashrc,/etc/zsh/zshrc' for root and '~/.bashrc,~/.zshrc' for non-root | string | DEFAULT |
| python | Install Python keyring helper for pip | boolean | false |
| targetFiles | Comma-separated list of files to write aliases to | string | DEFAULT (`/etc/bash.bashrc,/etc/zsh/zshrc` for `root`, otherwise `~/.bashrc,~/.zshrc`) |

## Customizations

Expand Down Expand Up @@ -76,6 +76,29 @@ to download the package.

This feature is tested to work on Debian/Ubuntu and Mariner CBL 2.0

## Changing where functions are configured

By default, the functions are defined in `/etc/bash.bashrc` and `/etc/zsh/zshrc` if the container user is `root`, otherwise `~/.bashrc` and `~/.zshrc`.
This default configuration ensures that the functions are always available for any interactive shells.

In some cases it can be useful to have the functions written to a non-default location. For example:
- the configuration file of a shell other than `bash` and `zsh`
- a custom file which is not a shell configuration script (so that it can be `source`d in non-interactive shells and scripts)

To do this, set the `targetFiles` option to the path script path where the functions should be written. Note that the default paths WILL NOT be used
if the `targetFiles` option is provided, so you may want to include them in the overridden value, or add `source` the custom script in those configurations:

```bash
# .devcontainer/devcontainer.json
{
// ...
"targetFiles": "/custom/path/to/auth-helper.sh"
}

# ~/.bashrc

source /custom/path/to/auth-helper.sh
```

---

Expand Down