-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·36 lines (31 loc) · 1.26 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·36 lines (31 loc) · 1.26 KB
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
#!/bin/bash
FLAG="-i"
if [[ "$1" == "-f" ]]; then FLAG="-f"; fi
if cp $FLAG new_project.sh ~/.new_project.sh; then echo '~/.new_project.sh created..'; fi
if cp $FLAG new_class.sh ~/.new_class.sh; then echo '~/.new_class.sh created..'; fi
if cp $FLAG new_makefile.sh ~/.new_makefile.sh; then echo '~/.new_makefile.sh created..'; fi
if cp $FLAG new_all.sh ~/.new_all.sh; then echo '~/.new_all.sh created..'; fi
if ! grep "source ~/.new_project.sh" ~/.zshrc &> /dev/null ; then
echo 'source ~/.new_project.sh' >> ~/.zshrc
echo '"~/.new_project.sh" added to ~/.zshrc'
else
echo '"source ~/.new_project.sh" found inside ~/.zshrc'
fi
if ! grep "source ~/.new_class.sh" ~/.zshrc &> /dev/null ; then
echo 'source ~/.new_class.sh' >> ~/.zshrc
echo '"~/.new_project.sh" added to ~/.zshrc'
else
echo '"source ~/.new_class.sh" found inside ~/.zshrc'
fi
if ! grep "source ~/.new_makefile.sh" ~/.zshrc &> /dev/null ; then
echo 'source ~/.new_makefile.sh' >> ~/.zshrc
echo '"~/.new_project.sh" added to ~/.zshrc'
else
echo '"source ~/.new_makefile.sh" found inside ~/.zshrc'
fi
if ! grep "source ~/.new_all.sh" ~/.zshrc &> /dev/null ; then
echo 'source ~/.new_all.sh' >> ~/.zshrc
echo '"~/.new_all.sh" added to ~/.zshrc'
else
echo '"source ~/.new_all.sh" found inside ~/.zshrc'
fi