diff --git a/src/uv/NOTES.md b/src/uv/NOTES.md index 415b846..315baed 100644 --- a/src/uv/NOTES.md +++ b/src/uv/NOTES.md @@ -1,3 +1,23 @@ ## uv Repository -* [astral-sh/uv](https://github.com/astral-sh/uv) \ No newline at end of file +* [astral-sh/uv](https://github.com/astral-sh/uv) + +## Fix Autocompletion with feature Shells + +> [!IMPORTANT] +> When installing a shell via another feature, make sure to override the installation order to ensure the generated autocompletion writes to existing files. + +### Autocompletion for Fish Shell + +```json +"features": { + "ghcr.io/meaningful-ooo/devcontainer-features/fish:latest": {}, + "ghcr.io/va-h/devcontainers-features/uv:latest": { + "shellautocompletion": true + } +}, +"overrideFeatureInstallOrder": [ + "ghcr.io/meaningful-ooo/devcontainer-features/fish", + "ghcr.io/va-h/devcontainers-features/uv:latest" +] +``` diff --git a/src/uv/devcontainer-feature.json b/src/uv/devcontainer-feature.json index 3b9242e..e3699f3 100644 --- a/src/uv/devcontainer-feature.json +++ b/src/uv/devcontainer-feature.json @@ -1,6 +1,6 @@ { "id": "uv", - "version": "1.1.2", + "version": "1.1.3", "name": "uv", "documentationURL": "http://github.com/va-h/devcontainers-features/tree/main/src/uv", "description": "An extremely fast Python package and project manager, written in Rust.", @@ -19,4 +19,4 @@ "type": "boolean" } } -} \ No newline at end of file +} diff --git a/src/uv/install.sh b/src/uv/install.sh index 6dd891c..5980567 100644 --- a/src/uv/install.sh +++ b/src/uv/install.sh @@ -162,8 +162,9 @@ enable_autocompletion() { if [ -f "$_REMOTE_USER_HOME/.zshrc" ]; then echo "eval \"\$(${command} zsh)\"" >> $_REMOTE_USER_HOME/.zshrc fi - if [ -f "$_REMOTE_USER_HOME/.config/fish/config.fish" ]; then - echo "${command} fish" >> $_REMOTE_USER_HOME/.config/fish/config.fish + if [ -d "$_REMOTE_USER_HOME/.config/fish" ]; then + mkdir -p $_REMOTE_USER_HOME/.config/fish/completions + ${command} fish >> $_REMOTE_USER_HOME/.config/fish/completions/uv.fish fi if [ -f "$_REMOTE_USER_HOME/.elvish/rc.elv" ]; then echo "eval (${command} elvish | slurp)" >> $_REMOTE_USER_HOME/.elvish/rc.elv