Skip to content

Commit

Permalink
fix(sidecar): Fix ruby plugin setting default settings to be used (#813)
Browse files Browse the repository at this point in the history
Signed-off-by: Sun Seng David TAN <sutan@redhat.com>
  • Loading branch information
sunix authored Jan 25, 2021
1 parent 835b531 commit 68a9a70
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sidecars/ruby/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ FROM ruby:2.7.2-buster

ENV HOME=/home/theia

RUN apt-get update && \
apt-get install jq -y && \
apt-get clean && apt-get -y autoremove && rm -rf /var/lib/apt/lists/*

RUN mkdir /projects ${HOME} && \
# Change permissions to let any arbitrary user
for f in "${HOME}" "/etc/passwd" "/projects"; do \
Expand Down
6 changes: 6 additions & 0 deletions sidecars/ruby/etc/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,10 @@ if [ "${USER_ID}" -ne 0 ] && command -v sudo >/dev/null 2>&1 && sudo -n true > /
sudo chown "${USER_ID}:${GROUP_ID}" /projects
fi

echo 'Setting "solargraph.bundlerPath" to "/usr/local/bin/bundle" and "solargraph.commandPath" to "/usr/local/bundle/bin/solargraph"'
mkdir -p "${CHE_PROJECTS_ROOT}"/.theia ;
[ ! -f "${CHE_PROJECTS_ROOT}/.theia/settings.json" ] && echo "{}" > "${CHE_PROJECTS_ROOT}/.theia/settings.json"
jq '. += {"solargraph.bundlerPath":"/usr/local/bin/bundle"}' "${CHE_PROJECTS_ROOT}/.theia/settings.json" > /tmp/temp.json && mv /tmp/temp.json "${CHE_PROJECTS_ROOT}/.theia/settings.json"
jq '. += {"solargraph.commandPath":"/usr/local/bundle/bin/solargraph"}' "${CHE_PROJECTS_ROOT}/.theia/settings.json" > /tmp/temp.json && mv /tmp/temp.json "${CHE_PROJECTS_ROOT}/.theia/settings.json"

exec "$@"

0 comments on commit 68a9a70

Please sign in to comment.