别人克隆后没有 install,source 会直接失败。把展开后的 install 放进仓库,符号链接和指向本机 build 的 egg-link 收成真实文件,Python 入口改走当前环境的解释器,这样不用先 colcon build 也能启动。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
# generated from colcon_zsh/shell/template/prefix_chain.zsh.em
|
||||
|
||||
# This script extends the environment with the environment of other prefix
|
||||
# paths which were sourced when this file was generated as well as all packages
|
||||
# contained in this prefix path.
|
||||
|
||||
# function to source another script with conditional trace output
|
||||
# first argument: the path of the script
|
||||
_colcon_prefix_chain_zsh_source_script() {
|
||||
if [ -f "$1" ]; then
|
||||
if [ -n "$COLCON_TRACE" ]; then
|
||||
echo "# . \"$1\""
|
||||
fi
|
||||
. "$1"
|
||||
else
|
||||
echo "not found: \"$1\"" 1>&2
|
||||
fi
|
||||
}
|
||||
|
||||
# source chained prefixes
|
||||
# setting COLCON_CURRENT_PREFIX avoids determining the prefix in the sourced script
|
||||
# 不写死某一台机器的 conda。已激活的环境优先,否则找当前用户的 ros_flexiv。
|
||||
if [ -n "${CONDA_PREFIX:-}" ] && [ -f "${CONDA_PREFIX}/local_setup.zsh" ]; then
|
||||
COLCON_CURRENT_PREFIX="${CONDA_PREFIX}"
|
||||
elif [ -f "${HOME}/anaconda3/envs/ros_flexiv/local_setup.zsh" ]; then
|
||||
COLCON_CURRENT_PREFIX="${HOME}/anaconda3/envs/ros_flexiv"
|
||||
elif [ -f "${HOME}/miniconda3/envs/ros_flexiv/local_setup.zsh" ]; then
|
||||
COLCON_CURRENT_PREFIX="${HOME}/miniconda3/envs/ros_flexiv"
|
||||
else
|
||||
COLCON_CURRENT_PREFIX=""
|
||||
fi
|
||||
if [ -n "${COLCON_CURRENT_PREFIX}" ]; then
|
||||
_colcon_prefix_chain_zsh_source_script "$COLCON_CURRENT_PREFIX/local_setup.zsh"
|
||||
fi
|
||||
|
||||
# source this prefix
|
||||
# setting COLCON_CURRENT_PREFIX avoids determining the prefix in the sourced script
|
||||
COLCON_CURRENT_PREFIX="$(builtin cd -q "`dirname "${(%):-%N}"`" > /dev/null && pwd)"
|
||||
_colcon_prefix_chain_zsh_source_script "$COLCON_CURRENT_PREFIX/local_setup.zsh"
|
||||
|
||||
unset COLCON_CURRENT_PREFIX
|
||||
unset _colcon_prefix_chain_zsh_source_script
|
||||
Reference in New Issue
Block a user