Skip to content

Commit

Permalink
fix: use go-based powerline-shell (#358)
Browse files Browse the repository at this point in the history
  • Loading branch information
olevski authored Jun 15, 2023
1 parent ab7f5e5 commit c24c99a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 14 deletions.
3 changes: 2 additions & 1 deletion docker/py/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ RUN apt-get update && apt-get install -yq --no-install-recommends \
rm -rf /var/lib/apt/lists/* && \
ln -s /usr/lib/x86_64-linux-musl/libc.so /lib/libc.musl-x86_64.so.1 && \
wget -q https://github.com/git-lfs/git-lfs/releases/download/v3.3.0/git-lfs-linux-"$(dpkg --print-architecture)"-v3.3.0.tar.gz -P /tmp && \
wget -q https://github.com/justjanne/powerline-go/releases/download/v1.24/powerline-go-linux-"$(dpkg --print-architecture)" -O /usr/local/bin/powerline-shell && \
chmod a+x /usr/local/bin/powerline-shell && \
tar -zxvf /tmp/git-lfs-linux-"$(dpkg --print-architecture)"-v3.3.0.tar.gz -C /tmp && \
/tmp/git-lfs-3.3.0/install.sh && \
rm -rf /tmp/git-lfs*
Expand All @@ -75,7 +77,6 @@ RUN mkdir -p "$HOME/.ssh" && \
# configure bash and shell prompt
ENV PATH=$HOME/.local/bin:$PATH:$HOME/.renku/bin
COPY --chown=1000:100 bashrc /renku/
COPY --chown=1000:100 powerline.config /home/${NB_USER}/.config/powerline-shell/config.json
RUN cat "/renku/bashrc" >> "${HOME}/.bashrc"

COPY entrypoint.sh /entrypoint.sh
Expand Down
4 changes: 2 additions & 2 deletions docker/py/bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ if [[ -z "$(git config --global --get user.email)" && -v EMAIL ]]; then
fi

function _update_ps1() {
PS1=$(powerline-shell $?)
PS1="$(/usr/local/bin/powerline-shell -error $? -jobs $(jobs -p | wc -l) -mode compatible -modules ssh,venv,cwd,git,root)"
}

if [[ $TERM != linux && ! $PROMPT_COMMAND =~ _update_ps1 ]]; then
if [ "$TERM" != "linux" ] && [ -f "/usr/local/bin/powerline-shell" ]; then
PROMPT_COMMAND="_update_ps1; $PROMPT_COMMAND"
fi

Expand Down
10 changes: 0 additions & 10 deletions docker/py/powerline.config

This file was deleted.

1 change: 0 additions & 1 deletion docker/py/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ jupyterlab-git==0.41.0
jupyterlab-system-monitor~=0.8.0
mistune>=2.0.1 # not directly required, pinned by Snyk to avoid a vulnerability
papermill~=2.4.0
powerline-shell~=0.7.0
requests>=2.20.0
setuptools>=65.5.1 # not directly required, pinned by Snyk to avoid a vulnerability
virtualenv>=20.7.2
Expand Down

0 comments on commit c24c99a

Please sign in to comment.