From b55076bce0608bfc91722aa34e3406ec738b904c Mon Sep 17 00:00:00 2001 From: RJ Trujillo Date: Sat, 27 Jan 2024 19:07:40 -0700 Subject: [PATCH] feat(bluefin-cli): Enable atuin and ble.sh out of the box Retrieves and extracts ble.sh. Enables both atuin and ble.sh via the bashrc --- toolboxes/bluefin-cli/Containerfile.bluefin-cli | 7 +++++-- toolboxes/bluefin-cli/files/etc/bashrc | 4 ++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/toolboxes/bluefin-cli/Containerfile.bluefin-cli b/toolboxes/bluefin-cli/Containerfile.bluefin-cli index 059a78e..4c8e97a 100644 --- a/toolboxes/bluefin-cli/Containerfile.bluefin-cli +++ b/toolboxes/bluefin-cli/Containerfile.bluefin-cli @@ -24,5 +24,8 @@ RUN sed -i '349,489 s/^/#/' /usr/bin/entrypoint && \ sed -i '499,1355 s/^/#/' /usr/bin/entrypoint && \ sed -i '1357 s/^/#/' /usr/bin/entrypoint -# Change root shell to BASH -RUN sed -i -e '/^root/s/\/bin\/ash/\/bin\/bash/' /etc/passwd +# Use and configure bash, retrieve ble.sh +RUN wget -q $(curl -s https://api.github.com/repos/akinomyoga/ble.sh/releases/latest | grep "browser_download_url" | cut -d '"' -f 4) -O /tmp/ble.tar.xz && \ + mkdir -p /usr/share/blesh && \ + tar xJf /tmp/ble.tar.xz -C /usr/share/blesh --strip-components=1 && \ + sed -i -e '/^root/s/\/bin\/ash/\/bin\/bash/' /etc/passwd diff --git a/toolboxes/bluefin-cli/files/etc/bashrc b/toolboxes/bluefin-cli/files/etc/bashrc index ce1aa2f..d9c8686 100644 --- a/toolboxes/bluefin-cli/files/etc/bashrc +++ b/toolboxes/bluefin-cli/files/etc/bashrc @@ -48,6 +48,10 @@ if [ -z "$BASHRCSOURCED" ]; then STARSHIP_CONFIG=/etc/starship.toml export STARSHIP_CONFIG eval "$(starship init $SHELL)" + + # Enable atuin and ble.sh + source /usr/share/blesh/ble.sh + eval "$(atuin init $SHELL)" fi