就像前端的npm一样npm i是命令npm install的简写
我希望后端的pdm命令和poetry也支持简写i
poetry的话,MacOS和Linux可使用carstino里的.pipi.py文件,Windows的待研究
pdm则相对简单一点,只需配置shell命令时加多两行,变成如下即可:
pdm() {
local command=$1
if [[ "$command" == "shell" ]]; then
eval $(pdm venv activate)
elif [[ "$command" == "i" ]]; then
command pdm install ${@:2}
else
command pdm $@
fi
}
具体配置可参考:https://pdm-project.org/zh-cn/latest/usage/venv/#_9