Skip to content

Commit 36f754f

Browse files
author
github-actions
committed
Automated documentation update [skip ci]
1 parent 4b3a7bc commit 36f754f

File tree

1 file changed

+25
-2
lines changed

1 file changed

+25
-2
lines changed

src/artifacts-helper/README.md

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Configures Codespace to authenticate with Azure Artifact feeds
77

88
```json
99
"features": {
10-
"ghcr.io/microsoft/codespace-features/artifacts-helper:1": {}
10+
"ghcr.io/microsoft/codespace-features/artifacts-helper:2": {}
1111
}
1212
```
1313

@@ -23,8 +23,8 @@ Configures Codespace to authenticate with Azure Artifact feeds
2323
| yarnAlias | Create alias for yarn | boolean | true |
2424
| npxAlias | Create alias for npx | boolean | true |
2525
| rushAlias | Create alias for rush | boolean | true |
26+
| 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 |
2627
| python | Install Python keyring helper for pip | boolean | false |
27-
| targetFiles | Comma-separated list of files to write aliases to | string | DEFAULT (`/etc/bash.bashrc,/etc/zsh/zshrc` for `root`, otherwise `~/.bashrc,~/.zshrc`) |
2828

2929
## Customizations
3030

@@ -76,6 +76,29 @@ to download the package.
7676

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

79+
## Changing where functions are configured
80+
81+
By default, the functions are defined in `/etc/bash.bashrc` and `/etc/zsh/zshrc` if the container user is `root`, otherwise `~/.bashrc` and `~/.zshrc`.
82+
This default configuration ensures that the functions are always available for any interactive shells.
83+
84+
In some cases it can be useful to have the functions written to a non-default location. For example:
85+
- the configuration file of a shell other than `bash` and `zsh`
86+
- a custom file which is not a shell configuration script (so that it can be `source`d in non-interactive shells and scripts)
87+
88+
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
89+
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:
90+
91+
```bash
92+
# .devcontainer/devcontainer.json
93+
{
94+
// ...
95+
"targetFiles": "/custom/path/to/auth-helper.sh"
96+
}
97+
98+
# ~/.bashrc
99+
100+
source /custom/path/to/auth-helper.sh
101+
```
79102

80103
---
81104

0 commit comments

Comments
 (0)