From 92ec2ce572873014657ad0fe8bab1a32987774d0 Mon Sep 17 00:00:00 2001 From: David Birks Date: Thu, 30 May 2024 23:20:39 -0400 Subject: [PATCH] Enable bash completion for rye --- src/rye/devcontainer-feature.json | 9 ++++++++- src/rye/install.sh | 6 ++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/rye/devcontainer-feature.json b/src/rye/devcontainer-feature.json index 561e26a..8d874da 100644 --- a/src/rye/devcontainer-feature.json +++ b/src/rye/devcontainer-feature.json @@ -1,6 +1,6 @@ { "name": "Rye", - "version": "1.0.1", + "version": "1.1.0", "id": "rye", "description": "A Hassle-Free Python Experience", "installsAfter": [ @@ -13,6 +13,13 @@ "RYE_NO_AUTO_INSTALL": "1" }, "postCreateCommand": "echo 'source \"$HOME/.rye/env\"' >> ~/.profile", + "options": { + "bashCompletion": { + "type": "boolean", + "description": "Enable bash completion for Rye", + "default": true + } + }, "customizations": { "vscode": { "extensions": [ diff --git a/src/rye/install.sh b/src/rye/install.sh index b7e6659..6ed6e1d 100644 --- a/src/rye/install.sh +++ b/src/rye/install.sh @@ -7,3 +7,9 @@ echo "Activating feature 'rye'" # https://rye.astral.sh/guide/installation/#customized-installation curl -sSf https://rye.astral.sh/get | RYE_INSTALL_OPTION="--yes" bash + +if [ "$BASHCOMPLETION" == "true" ]; then + echo "Activating bash completion for 'rye'" + # https://rye.astral.sh/guide/installation/#shell-completion + rye self completion > /etc/bash_completion.d/rye +fi