Skip to content

Commit 0dff1a7

Browse files
committed
sdk: introduce the cd subcommand
Typically contributors want to work on specific projects, and to that end, we now provide a quick way to change the directory to the worktree of a given project. Example: sdk cd git Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 4a9b3bc commit 0dff1a7

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

git-extra/git-sdk.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,12 @@ sdk () {
2929
create-desktop-icon: install a desktop icon that starts the Git for
3030
Windows SDK Bash.
3131
32-
init <project>: initialize and/or update a worktree. Known projects
32+
cd <project>: initialize/update a worktree and cd into it. Known projects
3333
are: build-extra, git, MINGW-packages, MSYS2-packages.
3434
35+
init <project>: initialize and/or update a worktree. Known projects
36+
are the same as for the 'cd' command.
37+
3538
build <project>: builds one of the following: git, git-and-installer.
3639
EOF
3740
;;
@@ -85,6 +88,11 @@ sdk () {
8588
;;
8689
esac
8790
;;
91+
cd)
92+
sdk init "$2" &&
93+
cd "$src_dir" ||
94+
sdk die "Could not change directory to '$2'"
95+
;;
8896
init)
8997
sdk init-lazy "$2" &&
9098
git -C "$src_dir" pull origin master

0 commit comments

Comments
 (0)