-
-
Notifications
You must be signed in to change notification settings - Fork 43
/
Copy pathINSTALLER.sh
executable file
·50 lines (38 loc) · 1.06 KB
/
INSTALLER.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
#!/bin/bash
# TODO: check for required deps.
cp -r src .flutter-spy
chmod +x ./.flutter-spy/flutterspy
mv .flutter-spy ~/
new_path="export PATH=\$PATH:~/.flutter-spy"
if grep -Fxq "$new_path" ~/.bashrc
then
echo "Path already exists in .bashrc"
exit 1
else
onePresent=0
if [ -f ~/.zshrc ]; then
echo "$new_path" >> ~/.zshrc
source ~/.zshrc
echo "Path added to .zshrc"
onePresent=1
fi
if [ -f ~/.bashrc ]; then
echo "$new_path" >> ~/.bashrc
source ~/.bashrc
echo "Path added to .bashrc"
onePresent=1
fi
if [ -f ~/.profile ]; then
echo "$new_path" >> ~/.profile
source ~/.profile
echo "Path added to .profile"
onePresent=1
fi
if [ $onePresent -eq 0 ]; then
echo "No .bashrc, .zshrc or .profile found. Please add the following line to your shell config file:"
echo "$new_path"
exit 1
fi
fi
echo "Flutter Spy installed successfully!"
echo "open a new terminal and run 'flutterspy' to get started."