Skip to content

Commit

Permalink
Fixes;
Browse files Browse the repository at this point in the history
  • Loading branch information
braun-daniel committed Oct 10, 2024
1 parent ad8ca35 commit 8c02e8b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 29 deletions.
8 changes: 2 additions & 6 deletions src/fzf/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ echo "Installing git..."
apt-get update
apt-get install -y git

# Change to remote user
echo "Changing to remote user..."
su - "$_REMOTE_USER"

# Install fzf
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
~/.fzf/install
su - "$_REMOTE_USER" -c "git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf"
su - "$_REMOTE_USER" -c "~/.fzf/install"
11 changes: 3 additions & 8 deletions src/spaceship/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,8 @@ apt-get install -y zsh git

# Change to remote user
echo "Changing to remote user..."
su - "$_REMOTE_USER"

# Create the .zsh directory if it doesn't exist
# Install spaceship-prompt
mkdir -p "${_REMOTE_USER_HOME}/.zsh"

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

# Make sure the spaceship-prompt is permanently sourced in the .zshrc file
echo 'source "${_REMOTE_USER_HOME}/.zsh/spaceship/spaceship.zsh"' >> "${_REMOTE_USER_HOME}/.zshrc"
su - "$_REMOTE_USER" -c "git clone --depth=1 https://github.com/spaceship-prompt/spaceship-prompt.git ~/.zsh/spaceship"
su - "$_REMOTE_USER" -c "echo 'source \"~/.zsh/spaceship/spaceship.zsh\"' >> \"~/.zshrc\""
15 changes: 1 addition & 14 deletions test/fzf/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,7 @@ set -e
source dev-container-features-test-lib

# Definition specific tests
check "check for fzf" sudo -u "$_REMOTE_USER" fzf --version

# Depending on the shell (bash, zsh, fish), check if the config was added to the profiles
if [ -n "$BASH_VERSION" ]; then
check "check for fzf key bindings and fuzzy completion for bash" grep -q 'eval "$(fzf --bash)"' "${_REMOTE_USER_HOME}/.bashrc"
fi

if [ -n "$ZSH_VERSION" ]; then
check "check for fzf key bindings and fuzzy completion for zsh" grep -q 'source <(fzf --zsh)' "${_REMOTE_USER_HOME}/.zshrc"
fi

if [ -n "$FISH_VERSION" ]; then
check "check for fzf key bindings for fish" grep -q 'fzf --fish | source' "${_REMOTE_USER_HOME}/.config/fish/config.fish"
fi
check "check for fzf" su - "$_REMOTE_USER" -c "fzf --version"

# Report result
reportResults
2 changes: 1 addition & 1 deletion test/spaceship/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set -e
source dev-container-features-test-lib

# Definition specific tests
check "check for spaceship" sudo -u "$_REMOTE_USER" spaceship --version
check "check for spaceship" su -c "$_REMOTE_USER" -c "spaceship --version"

# Report result
reportResults

0 comments on commit 8c02e8b

Please sign in to comment.