From 36f754fa6f2ea1d27ff943b4a8d23c5565c4c229 Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 29 Jul 2024 17:25:49 +0000 Subject: [PATCH] Automated documentation update [skip ci] --- src/artifacts-helper/README.md | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/src/artifacts-helper/README.md b/src/artifacts-helper/README.md index ca10de1..705046c 100644 --- a/src/artifacts-helper/README.md +++ b/src/artifacts-helper/README.md @@ -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": {} } ``` @@ -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 @@ -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 +``` ---