diff --git a/src/starship/devcontainer-feature.json b/src/starship/devcontainer-feature.json index 135727c..145ab88 100644 --- a/src/starship/devcontainer-feature.json +++ b/src/starship/devcontainer-feature.json @@ -1,7 +1,18 @@ { "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": {}} + "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" + } +}