瀏覽代碼

fix: avoid error if no extra user python dirs

Kyle P Davis 1 年之前
父節點
當前提交
b67052263c
共有 1 個文件被更改,包括 2 次插入 和 1 次删除
  1. 2 1
      .profile

+ 2 - 1
.profile

@@ -19,7 +19,8 @@ OS=$(uname -s)
 export PATH="$PATH:$HOME/.local/bin:$HOME/bin"
 export PATH="$PATH:$HOME/.local/bin:$HOME/bin"
 
 
 # Setup user-specific Python overrides
 # Setup user-specific Python overrides
-if [ "$OS" = "Darwin" ]; then
+_PY_BASE_DIR="$HOME/Library/Python/";
+if [ "$OS" = "Darwin" ] && [ -d "$_PY_BASE_DIR" ]; then
 	for PY_DIR in "$HOME/Library/Python/"*/; do
 	for PY_DIR in "$HOME/Library/Python/"*/; do
 		export PATH="$PY_DIR/bin:$PATH"
 		export PATH="$PY_DIR/bin:$PATH"
 	done
 	done