-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathactivate
More file actions
executable file
·31 lines (25 loc) · 880 Bytes
/
activate
File metadata and controls
executable file
·31 lines (25 loc) · 880 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env bash
# Bash/Zsh activation script
# For fish shell users, use: source activate.fish
# Early fish detection to prevent parsing errors
test -n "$FISH_VERSION" && echo "ERROR: You are using fish shell. Use 'source activate.fish' instead." && return 1 2>/dev/null
# Determine the script location for bash/zsh
if [ -n "$BASH_SOURCE" ]; then
# Running in bash
SCRIPT_SOURCE="${BASH_SOURCE[0]}"
elif [ -n "$ZSH_VERSION" ]; then
# Running in zsh
SCRIPT_SOURCE="${(%):-%x}"
else
# Fallback
SCRIPT_SOURCE="$0"
fi
SCRIPT_DIR="$( cd "$( dirname "$SCRIPT_SOURCE" )" && pwd )"
# Check if we're in fish shell and redirect
if [ -n "$FISH_VERSION" ]; then
echo "Fish shell detected! Please use:"
echo " source $SCRIPT_DIR/activate.fish"
return 1 2>/dev/null || exit 1
fi
# Source the bash activation script
source "$SCRIPT_DIR/activate.sh"