Skip to content

Commit

Permalink
Do not run __portman_sync_env during init
Browse files Browse the repository at this point in the history
  • Loading branch information
canac committed Mar 20, 2024
1 parent 707bd73 commit 518b095
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ jobs:
- run: |
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
./e2e/setup.sh
./e2e/test_${{ matrix.shell }}.${{ matrix.shell }}
./e2e/test.${{ matrix.shell }}
2 changes: 2 additions & 0 deletions e2e/test_bash.bash → e2e/test.bash
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
set -ex

eval "$(portman init bash)"
$PROMPT_COMMAND

# Test shell integration setting port
test -n "$PORT"
test 4000 = "$PORTMAN_LINKED_PORT"
Expand Down
2 changes: 2 additions & 0 deletions e2e/test_fish.fish → e2e/test.fish
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env fish

portman init fish | source
__portman_prompt_hook

# Test shell integration setting port
test -n $PORT || return 1
test 4000 = $PORTMAN_LINKED_PORT || return 1
Expand Down
2 changes: 2 additions & 0 deletions e2e/test_zsh.zsh → e2e/test.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
set -ex

eval "$(portman init zsh)"
__portman_sync_env

# Test shell integration setting port
test -n "$PORT"
test 4000 = "$PORTMAN_LINKED_PORT"
Expand Down
2 changes: 0 additions & 2 deletions src/shells/init.bash
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,3 @@ if [[ -z "$PROMPT_COMMAND" ]]; then
elif [[ "$PROMPT_COMMAND" != *"__portman_sync_env"* ]]; then
PROMPT_COMMAND="__portman_sync_env;$PROMPT_COMMAND"
fi

__portman_sync_env
4 changes: 1 addition & 3 deletions src/shells/init.fish
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ function __portman_prompt_hook --on-event fish_prompt
end

function __portman_preexec_hook --on-event fish_preexec
# Without clearing the cd hook, the cd hook and prompt hook would both sync the port
# Without clearing the cd hook, the cd hook and prompt hook would both sync the environment
functions -e __portman_cd_hook
end

__portman_prompt_hook
2 changes: 0 additions & 2 deletions src/shells/init.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,3 @@ portman() {
autoload -Uz add-zsh-hook
add-zsh-hook chpwd __portman_sync_env
add-zsh-hook precmd __portman_sync_env

__portman_sync_env

0 comments on commit 518b095

Please sign in to comment.