-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·29 lines (27 loc) · 774 Bytes
/
setup.sh
File metadata and controls
executable file
·29 lines (27 loc) · 774 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
#!/bin/bash
func_name=mkdir_atcoder
if type $func_name >/dev/null 2>&1; then
echo "function $func_name already defined. skipped"
else
echo -ne "
function $func_name () {
mkdir \$PWD/\$1
cp $PWD/templates/A.cpp \$PWD/\$1/A.cpp
cp $PWD/templates/A.cpp \$PWD/\$1/B.cpp
cp $PWD/templates/A.cpp \$PWD/\$1/C.cpp
cp $PWD/templates/A.cpp \$PWD/\$1/D.cpp
cp $PWD/templates/A.cpp \$PWD/\$1/E.cpp
cp $PWD/templates/A.cpp \$PWD/\$1/F.cpp
}
" >> ~/.bashrc
echo "defined $func_name function in .bashrc"
fi
if [[ ":${CPATH}:" == *:"$PWD/include":* ]]; then
echo "CPATH already includes $PWD/include. skipped"
else
echo -ne "
# AtCoder
export CPATH=\$CPATH:$PWD/include
" >> ~/.bashrc
echo "added $PWD/include to \$CPATH in .bashrc"
fi