diff --git a/.goreleaser.yml b/.goreleaser.yml index fb0d468..e26a150 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -122,7 +122,7 @@ release: local cmd="$1" # Commands that should change directory - if [[ "$cmd" == "add" || "$cmd" == "switch" || "$cmd" == "sw" ]]; then + if [[ "$cmd" == "add" || "$cmd" == "switch" || "$cmd" == "sw" || "$cmd" == "setup" ]]; then # Capture stderr to look for WT_CHDIR while preserving stdout and interactive TUI local temp_file temp_file=$(mktemp) @@ -150,7 +150,7 @@ release: fi } ``` - After adding this function and restarting your shell (or running `source ~/.bashrc`/`source ~/.zshrc`), the `worktree add` and `worktree switch` commands will automatically change your current directory to the worktree location. + After adding this function and restarting your shell (or running `source ~/.bashrc`/`source ~/.zshrc`), the `worktree add`, `worktree switch`, and `worktree setup` commands will automatically change your current directory to the worktree location. ### Verification with Checksums Download `checksums.txt` and verify your binary: diff --git a/integration/integration_test.go b/integration/integration_test.go index 70e80e6..b889a99 100644 --- a/integration/integration_test.go +++ b/integration/integration_test.go @@ -48,13 +48,6 @@ func TestWorktreeFullWorkflow(t *testing.T) { require.NoError(t, err, "Failed to setup repository: %s", string(output)) t.Logf("Setup output: %s", string(output)) - // Verify repository structure was created - assert.DirExists(t, "worktree", "Repository directory should exist") - - // Change into repository directory - err = os.Chdir("worktree") - require.NoError(t, err) - // Verify basic repository structure assert.DirExists(t, ".bare", "Bare repository should exist") assert.FileExists(t, ".git", "Git directory file should exist") diff --git a/worktree.sh b/worktree.sh index ab1905b..812f626 100755 --- a/worktree.sh +++ b/worktree.sh @@ -21,7 +21,7 @@ worktree() { local cmd="$1" # Commands that should change directory - if [[ "$cmd" == "add" || "$cmd" == "switch" || "$cmd" == "sw" ]]; then + if [[ "$cmd" == "add" || "$cmd" == "switch" || "$cmd" == "sw" || "$cmd" == "setup" ]]; then # Capture stderr to look for WT_CHDIR while preserving stdout and interactive TUI local temp_file temp_file=$(mktemp)