Skip to content

Enable automatic generation of CDPATH variable for the lazy

username-removed-274314 requested to merge pc-add-cd-path-to-toolbelt into master

This enables automatic generation of CDPATH, this results in being able to just cd into whatever folder is inside of the root.

This is designed using the go style of package management, where, for example, for gitlab.com, we have the following structure:

./gitlab.com/gitlab-cog/postgres
./gitlab.com/gitlab-cog/swat
./gitlab.com/gitlab-com/infrastructure
./gitlab.com/gitlab-com/runbooks
./gitlab.com/gitlab-com/www-gitlab-com
./gitlab.com/gitlab-cookbooks/cookbook-about-gitlab-com
./gitlab.com/gitlab-cookbooks/cookbook-gitlab-runner
./gitlab.com/gitlab-cookbooks/cookbook-gitlab-test
./gitlab.com/gitlab-cookbooks/cookbook-marketo-tools
./gitlab.com/gitlab-cookbooks/cookbook-omnibus-gitlab
./gitlab.com/gitlab-cookbooks/cookbook-wrapper-gitlab-runner
./gitlab.com/gitlab-cookbooks/gitlab-attributes-with-secrets
./gitlab.com/gitlab-cookbooks/gitlab-backup
./gitlab.com/gitlab-cookbooks/gitlab-ceph
./gitlab.com/gitlab-cookbooks/gitlab-checkmk
./gitlab.com/gitlab-cookbooks/gitlab-chef-util
./gitlab.com/gitlab-cookbooks/gitlab-common
./gitlab.com/gitlab-cookbooks/gitlab-elastic
./gitlab.com/gitlab-cookbooks/gitlab-elk
./gitlab.com/gitlab-cookbooks/gitlab-haproxy
./gitlab.com/gitlab-cookbooks/gitlab-nfs-cluster
./gitlab.com/gitlab-cookbooks/gitlab-openssh
./gitlab.com/gitlab-cookbooks/gitlab-prometheus
./gitlab.com/gitlab-cookbooks/gitlab-server
./gitlab.com/gitlab-cookbooks/openssh
./gitlab.com/gitlab-org/gdk-ce
./gitlab.com/gitlab-org/gdk-ee
./gitlab.com/gitlab-org/gitlab-monitor
./gitlab.com/gl-infra/gitlab-com-infrastructure

So, with this enabled, I can just cd cookbook-about-gitlab-com and get into ~/gitlab.com/gitlab-cookbooks/cookbook-about-gitlab-com from anywhere.

Because I'm that lazy.

Merge request reports