如何设置PS1使git和conda都可以在bash中显示? 带有 virtualenv 和 git 分支的 Bash 命令提示符
我找到了以下关于如何在bash shell 中执行此操作的信息,但我在 macOS 中使用zsh。使用 zsh 会以同样的方式工作吗?我的 ~/.zshrc 中有以下内容
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/Users/carlos/opt/anaconda3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/blah/profile.d/conda.sh" ]; then
. "/blah/opt/anaconda3/etc/profile.d/conda.sh"
else
export PATH="/blah/opt/anaconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<
Run Code Online (Sandbox Code Playgroud)
我尝试使用此链接https://medium.com/pareture/simplest-zsh-prompt-configs-for-git-branch-name-3d01602a6f33,但它不包含 git 分支信息。有人可以对此进行扩展,以便包含 git 分支信息吗?
我最近将 package.json 中的依赖项升级到最新版本。依赖项已过时至少 2 年或更长时间。我正在处理的网站显示各种类型的图形和图表,并且在升级到 package.json 之前工作正常。这会是什么原因呢?
这是更新后的 package.json
{
"name": "pipeline-viewer",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "^12.0.0",
"@angular/cdk": "^12.0.0",
"@angular/common": "^12.0.0",
"@angular/compiler": "^12.0.0",
"@angular/core": "^12.0.0",
"@angular/flex-layout": "^12.0.0-beta.35",
"@angular/forms": "^12.0.0",
"@angular/material": "^12.0.0",
"@angular/material-moment-adapter": "^12.0.0",
"@angular/platform-browser": "^12.0.0",
"@angular/platform-browser-dynamic": "^12.0.0",
"@angular/router": "^12.0.0",
"@wizpanda/super-gif": "0.0.5",
"angular-plotly.js": "^4.0.4",
"bootstrap": "^5.1.3",
"moment": "^2.29.1",
"plotly.js": "^2.5.1",
"rxjs": "^7.4.0",
"rxjs-compat": "^6.6.7",
"zone.js": "^0.11.4"
},
"devDependencies": …
Run Code Online (Sandbox Code Playgroud)