Ensure we're in the GDK root before running cmds
What does this Merge Request do and why?
This MR fixes an issue with Gitpod where opening a new bash terminal results in an annoying error:
The current working directory is not inside a gitlab-development-kit
installation. Use 'cd' to go to your gitlab-development-kit or create
a new one with 'gdk init'.
gdk init [DIRECTORY] # Default: /workspace/gitlab/gitlab-development-kit
port "" is not a valid number
The reason behind this error is because when opening a new bash terminal, the working directory is /workspace/gitlab
which does not contain a GDK install. /workspace/gitlab
is symlinked as /workspace/gitlab-development-kit/gitlab
which allows the GDK to work and needs to work this way because when a new Gitpod instance is created, it's created via gitlab-org/gitlab
which is checked out into /workspace/gitlab
.
Merge Request checklist
-
This change is backward compatible. If not, please include steps to communicate to our users. -
Tests added for new functionality. If not, please raise Issue to follow-up. -
Documentation added/updated, if needed. -
gdk doctor
test added, if needed. -
Add the ~highlight
label if this MR should be included in theCHANGELOG.md
.
Closes #1339 (closed)