-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall.sh
executable file
·79 lines (66 loc) · 1.82 KB
/
install.sh
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/bin/bash
# Source accessories.sh for utility functions
POTIONS_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$POTIONS_ROOT/packages/accessories.sh"
update_potions() {
log 'Sending Potions files to HOME...'
cp -r .potions ~/
}
prepare_system() {
if is_macos; then
unpack_it 'macos/homebrew'
fi
update_repositories
update_potions
}
install_packages() {
local packages=(
'curl'
'wget'
'git'
'openvpn'
'zsh'
'antidote'
'tmux'
'neovim'
'vim-plug'
)
for pkg in "${packages[@]}"; do
unpack_it "common/$pkg"
done
}
if [[ "$1" == "--only-dotfiles" ]]; then
log 'Updating only dotfiles...'
update_potions
else
log 'Preparing System...'
prepare_system
log 'Installing Packages...'
install_packages
log 'Installation completed!'
# Create a script that properly sets up the Potions environment
POTIONS_SETUP="$HOME/.potions/activate.sh"
cat > "$POTIONS_SETUP" << 'EOF'
#!/bin/bash
# Potions activation script
# Set Zsh directory
export ZDOTDIR="$HOME/.potions"
# Display welcome message
echo "🧪 Potions has been installed successfully!"
echo "Your development environment is now ready."
echo ""
echo "This terminal session is still using your original shell."
echo "You can either:"
echo " 1. Close this terminal and open a new one (recommended)"
echo " 2. Type 'zsh' to switch to Zsh with Potions now"
echo ""
echo "All new terminal sessions will automatically use Potions."
EOF
chmod +x "$POTIONS_SETUP"
log "To complete setup, I recommend closing this terminal and opening a new one."
log "This will start a fresh session with your Potions environment."
log ""
log "If you want to explore Potions now, simply type 'zsh' to start a new shell session."
# Source the activation script for immediate information
source "$POTIONS_SETUP"
fi