Skip to content

Create and update shell profile if not found (ASDF installation); modify troubleshoot page

What does this merge request do and why?

Creates and Updates default shell profile if not found (ASDF installation); modify troubleshoot page

  • create and update .bashrc/.zshrc during asdf installation if they are deafult shells and not found. If not default, then user is notified to update shell config.
  • modify troubleshoot page and move the solution to this issue to the main page (from asdf troubleshoot page).

If shell profile is not found, the asdf installation fails silently and gdk command does not work.

How to set up and validate locally

  1. Setup a container, or virtual machine (say Ubuntu).
  2. Clone my fork (https://gitlab.com/chettriyuvraj/gitlab-development-kit).
  3. Ensure .asdf directory does not already exist, otherwise the asdf install step will be skipped.
  4. Modify the 'ensure_gdk_clone_branch_checked_out' function in the gitlab-development-kit/support/install file and add a command to checkout branch 'asdf-update-shell-profile'.
  5. Setup a new directory somewhere and run the gitlab-development-kit/support/install file in it - once gitlab-development-kit is cloned in the directory, change origin to https://gitlab.com/chettriyuvraj/gitlab-development-kit.
  6. Test various cases:
    • bash/zsh is the default shell but config file .bashrc/.zshrc does not exist
    • bash/zsh is the default shell and config file .bashrc/.zshrc exists
    • bash/zsh is not the default shell.
    • It is a little tricky to test the case where asdf command exists and asdf_add_initializer is triggered, because we already have a guard if [[ ! -d "${CURRENT_ASDF_DIR}" ]] before it which prevents asdf_add_initializer from being triggered if asdf directory exists. You will have to create your own fork and branch similar to steps 1-3 where the directory check must be commented out. If .asdf command already exists, asdf_add_initializer function will exit early due to its first guard check.

Note: You will have to delete/rename the asdf directory for each test to ensure the asdf install step is executed.

Impacted categories

The following categories relate to this merge request:

Merge request checklist

  • This change is backward compatible. If not, please include steps to communicate to our users.
  • Documentation added/updated, if needed.
Edited by Yuvraj Chettri

Merge request reports