From 0213123a9b9c3d0cd1396a7a73691933ef17dc1b Mon Sep 17 00:00:00 2001 From: manolo Date: Wed, 5 Feb 2025 16:07:07 +0000 Subject: [PATCH 1/4] fix: Check for the existance of the fish config folder. Generate completion on separated file --- src/uv/install.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 From 498813ed4cbdfdbc9117851750c4aa71b925cd64 Mon Sep 17 00:00:00 2001 From: manolo Date: Wed, 5 Feb 2025 16:07:30 +0000 Subject: [PATCH 2/4] docs: Override features installation order --- src/uv/NOTES.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/uv/NOTES.md b/src/uv/NOTES.md index 415b846..4cb04ed 100644 --- a/src/uv/NOTES.md +++ b/src/uv/NOTES.md @@ -1,3 +1,20 @@ ## 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) + +## Autocompletion for other shells than Bash + +When installing a shell via another feature, make sure to override the installation order to make sure that the autocomplatetion takes place. Here is an example installing the Fish shell and enabling autocompletion for it: + +```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" +] +``` From 264c1a192e0b730e75f3c2c203f4e81261282bdd Mon Sep 17 00:00:00 2001 From: Valentin <10695455+va-h@users.noreply.github.com> Date: Wed, 5 Feb 2025 20:38:59 +0100 Subject: [PATCH 3/4] docs: fixed a typo --- src/uv/NOTES.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/uv/NOTES.md b/src/uv/NOTES.md index 4cb04ed..315baed 100644 --- a/src/uv/NOTES.md +++ b/src/uv/NOTES.md @@ -2,10 +2,13 @@ * [astral-sh/uv](https://github.com/astral-sh/uv) -## Autocompletion for other shells than Bash +## Fix Autocompletion with feature Shells -When installing a shell via another feature, make sure to override the installation order to make sure that the autocomplatetion takes place. Here is an example installing the Fish shell and enabling autocompletion for it: +> [!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": {}, From 3f57ef7ad1fd5be1e99afa073ac2ecff9a2e956f Mon Sep 17 00:00:00 2001 From: Valentin <10695455+va-h@users.noreply.github.com> Date: Wed, 5 Feb 2025 20:41:47 +0100 Subject: [PATCH 4/4] chore: bumped patch version of uv feature --- src/uv/devcontainer-feature.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 +}