Skip to content

Commit

Permalink
Added spaceship;
Browse files Browse the repository at this point in the history
  • Loading branch information
braun-daniel committed Oct 8, 2024
1 parent 8927715 commit 3b220e8
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/fzf/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "fzf",
"id": "fzf",
"version": "1.0.0",
"version": "0.0.1",
"description": "Installs fzf - a command line fuzzy search.",
"installsAfter": [
"ghcr.io/devcontainers/features/common-utils"
Expand Down
9 changes: 9 additions & 0 deletions src/spaceship/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "Spaceship",
"id": "spaceship",
"version": "0.0.1",
"description": "Installs spaceship-prompt.",
"installsAfter": [
"ghcr.io/devcontainers/features/common-utils"
]
}
17 changes: 17 additions & 0 deletions src/spaceship/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
# This script installs spaceship-prompt into the DevContainer user's home directory.

# Exit script on any error
set -e

# Ensure the DevContainer user's home directory is used
DEVCONTAINER_HOME="${HOME}"

# Create the .zsh directory if it doesn't exist
mkdir -p "$DEVCONTAINER_HOME/.zsh"

# Clone the spaceship-prompt repository into the .zsh directory
git clone --depth=1 https://github.com/spaceship-prompt/spaceship-prompt.git "$DEVCONTAINER_HOME/.zsh/spaceship"

# Make sure the spaceship-prompt is permanently sourced in the .zshrc file
echo 'source "$HOME/.zsh/spaceship/spaceship.zsh"' >> "$DEVCONTAINER_HOME/.zshrc"
12 changes: 12 additions & 0 deletions test/spaceship/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

set -e

# Optional: Import test library
source dev-container-features-test-lib

# Definition specific tests
check "check for spaceship" grep -q 'spaceship-prompt' ~/.zshrc

# Report result
reportResults

0 comments on commit 3b220e8

Please sign in to comment.