Compare commits

...

2 Commits

Author SHA1 Message Date
Yuhao Qing
9641876d43 Add a new option 2025-12-18 18:10:03 +08:00
Yuhao Qing
d8238c545a fix 2025-12-18 18:07:17 +08:00

View File

@@ -1,6 +1,26 @@
# # Patch prep_env.sh for zsh compatibility (only if not already patched)
# _prep_env="/workspace/vscode/prep_env.sh"
# if [[ -f "$_prep_env" ]] && ! grep -q '# PATCHED_FOR_ZSH' "$_prep_env" 2>/dev/null; then
# sed -i \
# -e '1a# PATCHED_FOR_ZSH' \
# -e 's/^shopt -s histappend$/[[ -n "${BASH_VERSION}" ]] \&\& shopt -s histappend/' \
# -e 's/\${!\([^}]*\)}/\$( [[ -n "\${ZSH_VERSION}" ]] \&\& echo "\${(P)\1}" || echo "\${!\1}" )/g' \
# -e 's/cur_dir="\$(cd "\$(dirname "\$0")" && pwd)"/cur_dir="\/workspace\/vscode"/' \
# "$_prep_env"
# fi
# # Now source the patched script directly
# source "$_prep_env"
# Set cur_dir before sourcing so prep_env.sh uses the correct path
export cur_dir="/workspace/vscode"
# Patch prep_env.sh for zsh compatibility before sourcing
source <(sed -e 's/^shopt -s histappend$/[[ -n "${BASH_VERSION}" ]] \&\& shopt -s histappend/' \
-e 's/\${!\([^}]*\)}/${(P)\1}/g' \
-e 's/cur_dir="\$(cd "\$(dirname "\$0")" && pwd)"/# cur_dir already set/g' \
/workspace/mlx/../vscode/prep_env.sh)
# sh -c /opt/tiger/mlx_deploy/greeting.sh
@@ -13,8 +33,6 @@ if [ -f "/opt/tiger/rh2_bashrc" ]; then
source /opt/tiger/rh2_bashrc
fi
source /opt/tiger/mlx_deploy/userrc
. "$HOME/.cargo/env"
# huggingface proxy