Skip to content

Commit 0dcd185

Browse files
authored
Merge pull request #8 from mmartinortiz/fix-uv-completions-on-fish
Fix uv completions on fish
2 parents 69d4933 + 3f57ef7 commit 0dcd185

3 files changed

Lines changed: 26 additions & 5 deletions

File tree

src/uv/NOTES.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
11
## uv Repository
22

3-
* [astral-sh/uv](https://github.com/astral-sh/uv)
3+
* [astral-sh/uv](https://github.com/astral-sh/uv)
4+
5+
## Fix Autocompletion with feature Shells
6+
7+
> [!IMPORTANT]
8+
> When installing a shell via another feature, make sure to override the installation order to ensure the generated autocompletion writes to existing files.
9+
10+
### Autocompletion for Fish Shell
11+
12+
```json
13+
"features": {
14+
"ghcr.io/meaningful-ooo/devcontainer-features/fish:latest": {},
15+
"ghcr.io/va-h/devcontainers-features/uv:latest": {
16+
"shellautocompletion": true
17+
}
18+
},
19+
"overrideFeatureInstallOrder": [
20+
"ghcr.io/meaningful-ooo/devcontainer-features/fish",
21+
"ghcr.io/va-h/devcontainers-features/uv:latest"
22+
]
23+
```

src/uv/devcontainer-feature.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "uv",
3-
"version": "1.1.2",
3+
"version": "1.1.3",
44
"name": "uv",
55
"documentationURL": "http://github.com/va-h/devcontainers-features/tree/main/src/uv",
66
"description": "An extremely fast Python package and project manager, written in Rust.",
@@ -19,4 +19,4 @@
1919
"type": "boolean"
2020
}
2121
}
22-
}
22+
}

src/uv/install.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,9 @@ enable_autocompletion() {
162162
if [ -f "$_REMOTE_USER_HOME/.zshrc" ]; then
163163
echo "eval \"\$(${command} zsh)\"" >> $_REMOTE_USER_HOME/.zshrc
164164
fi
165-
if [ -f "$_REMOTE_USER_HOME/.config/fish/config.fish" ]; then
166-
echo "${command} fish" >> $_REMOTE_USER_HOME/.config/fish/config.fish
165+
if [ -d "$_REMOTE_USER_HOME/.config/fish" ]; then
166+
mkdir -p $_REMOTE_USER_HOME/.config/fish/completions
167+
${command} fish >> $_REMOTE_USER_HOME/.config/fish/completions/uv.fish
167168
fi
168169
if [ -f "$_REMOTE_USER_HOME/.elvish/rc.elv" ]; then
169170
echo "eval (${command} elvish | slurp)" >> $_REMOTE_USER_HOME/.elvish/rc.elv

0 commit comments

Comments
 (0)