diff --git a/src/gitbutler/devcontainer-feature.json b/src/gitbutler/devcontainer-feature.json index c5c2e66..17b9806 100644 --- a/src/gitbutler/devcontainer-feature.json +++ b/src/gitbutler/devcontainer-feature.json @@ -1,6 +1,6 @@ { "id": "gitbutler", - "version": "0.1.1", + "version": "0.1.2", "name": "GitButler CLI", "description": "Installs the GitButler CLI (but).", "documentationURL": "https://github.com/Synergy-Shock/devcontainer-features/tree/main/src/gitbutler", diff --git a/src/gitbutler/install.sh b/src/gitbutler/install.sh index ecec42e..ba1bcfc 100755 --- a/src/gitbutler/install.sh +++ b/src/gitbutler/install.sh @@ -53,4 +53,15 @@ curl -fsSL -o "${BUT_BIN}" "${BUT_URL}" chmod +x "${BUT_BIN}" "${BUT_BIN}" --version +if [ -n "${_REMOTE_USER:-}" ] && [ "${_REMOTE_USER}" != "root" ]; then + REMOTE_USER_HOME="${_REMOTE_USER_HOME:-/home/${_REMOTE_USER}}" + GITBUTLER_DATA_DIR="${REMOTE_USER_HOME}/.local/share/com.gitbutler.app" + echo "==> Pre-creating ${GITBUTLER_DATA_DIR} for ${_REMOTE_USER}..." + mkdir -p "${GITBUTLER_DATA_DIR}" + chown -R "${_REMOTE_USER}:${_REMOTE_USER}" \ + "${REMOTE_USER_HOME}/.local" \ + "${REMOTE_USER_HOME}/.local/share" \ + "${GITBUTLER_DATA_DIR}" +fi + echo "==> GitButler feature installation complete!"