From 1642e9981a14b5a9d83cca6c4a22ae84a3f9d16c Mon Sep 17 00:00:00 2001 From: Ty Schlich Date: Thu, 4 Sep 2025 22:02:05 +0000 Subject: [PATCH 1/3] feat: add character option for configuration --- src/starship/devcontainer-feature.json | 9 +++++++++ src/starship/install.sh | 5 ++++- test/starship/change_prompt_symbol.sh | 13 +++++++++++++ test/starship/scenarios.json | 11 +++++++++++ 4 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 test/starship/change_prompt_symbol.sh create mode 100644 test/starship/scenarios.json diff --git a/src/starship/devcontainer-feature.json b/src/starship/devcontainer-feature.json index 135727c..f5352e4 100644 --- a/src/starship/devcontainer-feature.json +++ b/src/starship/devcontainer-feature.json @@ -4,4 +4,13 @@ "name": "Starship", "description": "The minimal, blazing-fast, and infinitely customizable prompt for any shell!", "dependsOn": {"ghcr.io/devcontainers/features/common-utils:2": {}} + "postCreateCommand": "mkdir -p ${HOME}/.config && cp /usr/local/share/.config/starship.toml $HOME/.config/starship.toml", + "options": { + "character": { + "type": "string", + "default": "", + "description": "Key/value pairs for `character` configuration table.", + "proposals": ["success_symbol = '[➜](bold green)', error_symbol = '[✗](bold red) '"] + } + } } diff --git a/src/starship/install.sh b/src/starship/install.sh index ff214bb..deca51a 100644 --- a/src/starship/install.sh +++ b/src/starship/install.sh @@ -1,3 +1,6 @@ -#!/bin/env bash +#!/usr/bin/env bash curl -sS https://starship.rs/install.sh | sh -s -- -y + +mkdir -p /usr/local/share/.config +echo "character = { $CHARACTER }" >> /usr/local/share/.config/starship.toml diff --git a/test/starship/change_prompt_symbol.sh b/test/starship/change_prompt_symbol.sh new file mode 100644 index 0000000..8f6c1ad --- /dev/null +++ b/test/starship/change_prompt_symbol.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +set -e + +source dev-container-features-test-lib + +env + + +check "success symbol modified" starship print-config character | grep ➜ +check "error symbol modified" starship print-config character | grep ✗ + +reportResults diff --git a/test/starship/scenarios.json b/test/starship/scenarios.json new file mode 100644 index 0000000..5a353b0 --- /dev/null +++ b/test/starship/scenarios.json @@ -0,0 +1,11 @@ +{ + "change_prompt_symbol": { + "image": "ubuntu:focal", + "features": { + "starship": { + "character": "success_symbol = '[➜](bold green)', error_symbol = '[✗](bold red) '" + } + }, + "remoteUser": "testUserFoo" + } +} From c73b8decb631a37ab51a336e3d2235d40c0e6c31 Mon Sep 17 00:00:00 2001 From: Ty Schlich Date: Thu, 4 Sep 2025 22:03:25 +0000 Subject: [PATCH 2/3] chore: bump to minor release alpha --- src/starship/devcontainer-feature.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/starship/devcontainer-feature.json b/src/starship/devcontainer-feature.json index f5352e4..e87ae32 100644 --- a/src/starship/devcontainer-feature.json +++ b/src/starship/devcontainer-feature.json @@ -1,6 +1,6 @@ { "id": "starship", - "version": "0.1.6", + "version": "0.2.0-a1", "name": "Starship", "description": "The minimal, blazing-fast, and infinitely customizable prompt for any shell!", "dependsOn": {"ghcr.io/devcontainers/features/common-utils:2": {}} From 2b4bea60553ddbf519a04b4e6ae9928a0a83e79a Mon Sep 17 00:00:00 2001 From: Ty Schlich Date: Thu, 4 Sep 2025 22:43:12 +0000 Subject: [PATCH 3/3] fix: syntax bug --- src/starship/devcontainer-feature.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/starship/devcontainer-feature.json b/src/starship/devcontainer-feature.json index e87ae32..145ab88 100644 --- a/src/starship/devcontainer-feature.json +++ b/src/starship/devcontainer-feature.json @@ -3,7 +3,9 @@ "version": "0.2.0-a1", "name": "Starship", "description": "The minimal, blazing-fast, and infinitely customizable prompt for any shell!", - "dependsOn": {"ghcr.io/devcontainers/features/common-utils:2": {}} + "dependsOn": { + "ghcr.io/devcontainers/features/common-utils:2": {} + }, "postCreateCommand": "mkdir -p ${HOME}/.config && cp /usr/local/share/.config/starship.toml $HOME/.config/starship.toml", "options": { "character": {