-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·44 lines (30 loc) · 1.05 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
#!/bin/bash
GREEN="\033[32m"
NC="\033[0m"
BOLD='\033[1m'
sudo cp ./create-laravel-app /usr/bin
sudo touch /var/log/create-laravel-app.log
sudo chmod +x /usr/bin/create-laravel-app
sudo chown "$USER" /var/log/create-laravel-app.log
sudo chmod +x ./uninstall.sh
if [[ -f ~/.zshrc ]]; then
if [[ $(grep -c "alias cla" ~/.zshrc) -eq 0 ]]; then
echo $'alias cla="source create-laravel-app"' >>~/.zshrc
fi
if [[ $(grep -c "alias create-laravel-app" ~/.zshrc) -eq 0 ]]; then
echo $'alias create-laravel-app="source create-laravel-app"' >>~/.zshrc
fi
echo ""
echo -e "${GREEN}${BOLD}↪ Install completed !${NC}"
exec zsh
elif [[ -f ~/.bashrc ]]; then
if [[ $(grep -c "alias cla" ~/.bashrc) -eq 0 ]]; then
echo $'alias cla="source create-laravel-app"' >>~/.bashrc
fi
if [[ $(grep -c "alias create-laravel-app" ~/.bashrc) -eq 0 ]]; then
echo $'alias create-laravel-app="source create-laravel-app"' >>~/.bashrc
fi
echo ""
echo -e "${GREEN}${BOLD}↪ Install completed !${NC}"
exec zsh
fi