Za każdym razem, gdy otwieram iTerm, mój plik .zshrc otrzymuje nową linię ścieżki vscode

1
# iTerm
# CMD + D to split screen (left right)
# CMD + D + Shift to split screen (up down)
# Add Visual Studio Code (code)
export PATH="$PATH:/Applications/Visual Studio Code.app/Contents/Resources/app/bin"
# Add Visual Studio Code (code)
export PATH="$PATH:/Applications/Visual Studio Code.app/Contents/Resources/app/bin"
# Add Visual Studio Code (code)
export PATH="$PATH:/Applications/Visual Studio Code.app/Contents/Resources/app/bin"

Usunąłem wszystkie oprócz 1, kiedy zamykam i ponownie otwieram iTerm2. Dodaje kolejną linię :(

Pełny plik .zshrc

cat << EOF >> ~/.zshrc
# Add Visual Studio Code (code)
export PATH="\$PATH:/Applications/Visual Studio Code.app/Contents/Resources/app/bin"
EOF

export PATH="/usr/local/opt/node@8/bin:$PATH"
export NODE_ENV
export EDITOR='atom -w'i
# export EDITOR='/usr/local/bin/atom'
export TERM="xterm-256color"
export ZSH=/Users/leongaban/.oh-my-zsh
export GIT_EDITOR=vim

# trade.io
alias trade="projects/trade.io/"
# alias tradefe="projects/trade.io/tradeio-front"
alias tradefe="projects/trade.io/frontend"
alias chrome="open /Applications/Google\ Chrome.app --args --disable-web-security --user-data-dir --ignore-certificate-errors"

# heroku
alias herokuprod="git push heroku master"
# alias herokustag="git push heroku master"

# personal
alias leongaban="projects/leongaban/"
alias gaban="projects/Gaban/"
alias moon="projects/Futuratum/moon.holdings"
alias moonio="projects/Futuratum/moonholdings.io"
alias moonnode="projects/Futuratum/moon.node"

alias futr="projects/Futuratum/"
alias tuts="projects/tutorials/"
alias udemy="projects/tutorials/udemy/"
alias areact="projects/tutorials/wesbos/Advanced-React"

# Configs
alias zconfig="atom ~/.zshrc"
alias ohmyzsh="atom ~/.oh-my-zsh"
alias hconfig="atom ~/.hyper.js"
alias gconfig="atom ~/.gitconfig"
alias hosts="sudo atom /etc/hosts"

# Yarn scripts
alias yarnstart="yarn start-legacy"

# Yarn jest tests
alias ju="npm t -- --u"
alias jw="yarn run test-jest:watch"
alias jt="yarn jest test"
alias jc="yarn run test-jest:coverage"

alias myip="ifconfig | grep "inet " | grep -Fv 127.0.0.1 | awk '{print $2}'"

alias reset='clear && printf "\e[3J"'

# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
# ZSH_THEME="robbyrussell"
ZSH_THEME="kolo"

# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder

# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
# plugins=(git)

source $ZSH/oh-my-zsh.sh

# ssh
# export SSH_KEY_PATH="~/.ssh/rsa_id"

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion

# iTerm
# CMD + D to split screen (left right)
# CMD + D + Shift to split screen (up down)
# Add Visual Studio Code (code)
export PATH="$PATH:/Applications/Visual Studio Code.app/Contents/Resources/app/bin"
Leon Gaban
źródło

Odpowiedzi:

0

Westchnienie, właśnie to rozgryzłem ... Nie jestem pewien, dlaczego to tutaj umieściłem.

cat << EOF >> ~/.zshrc
# Add Visual Studio Code (code)
export PATH="\$PATH:/Applications/Visual Studio Code.app/Contents/Resources/app/bin"
EOF

Ale usunąłem to i wszystko działa.

Leon Gaban
źródło