Refactor
This commit is contained in:
parent
7d13baa11d
commit
d20a094d17
1 changed files with 56 additions and 182 deletions
|
@ -2,76 +2,54 @@
|
|||
|
||||
## This script clones all the different repos
|
||||
|
||||
set_up_2px_repo() {
|
||||
repo_name="$1"
|
||||
folder="$2"
|
||||
echo "Setting up $repo_name..."
|
||||
if [ -e ~/"$folder""$repo_name" ]; then
|
||||
echo "${GREEN}$repo_name is already there, updating...${NC}"
|
||||
echo "${RED}Going into ~/${folder}${repo_name}${NC}"
|
||||
cd ~/"$folder""$repo_name" && git pull
|
||||
else
|
||||
echo "${ORANGE}Cloning new $repo_name...${NC}"
|
||||
echo "${RED}Going into ~/${folder}${NC}"
|
||||
cd ~/"$folder" && git clone ssh://flyingscorpio@2px.info.tm/~/repos/"$repo_name".git
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
set_up_gitlab_repo() {
|
||||
repo_owner="$1"
|
||||
repo_name="$2"
|
||||
folder="$3"
|
||||
echo "Setting up $repo_owner/$repo_name..."
|
||||
if [ -e ~/"$folder""$repo_name" ]; then
|
||||
echo "${GREEN}$repo_name is already there, updating...${NC}"
|
||||
echo "${RED}Going into ~/${folder}${repo_name}${NC}"
|
||||
cd ~/"$folder""$repo_name" && git pull
|
||||
else
|
||||
echo "${ORANGE}Cloning new $repo_name...${NC}"
|
||||
echo "${RED}Going into ~/${folder}${NC}"
|
||||
cd ~/"$folder" && git clone https://gitlab.com/"$repo_owner"/"$repo_name".git
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
# REPOS ON LIME2 {{{
|
||||
|
||||
echo "Setting up Lessons..."
|
||||
if [ ! -e ~/Lessons ]; then
|
||||
mkdir ~/Lessons
|
||||
fi
|
||||
|
||||
echo "Setting up E2L..."
|
||||
if [ -e ~/Lessons/E2L ]; then
|
||||
echo "${GREEN}E2L is already there, updating...${NC}"
|
||||
cd ~/Lessons/E2L && git pull
|
||||
else
|
||||
echo "${ORANGE}Cloning new E2L...${NC}"
|
||||
cd ~/Lessons && git clone ssh://flyingscorpio@2px.info.tm/~/repos/E2L.git
|
||||
fi
|
||||
|
||||
echo "Setting up OpenClassrooms..."
|
||||
if [ -e ~/Lessons/OpenClassrooms ]; then
|
||||
echo "${GREEN}OpenClassrooms is already there, updating...${NC}"
|
||||
cd ~/Lessons/OpenClassrooms && git pull
|
||||
else
|
||||
echo "${ORANGE}Cloning new OpenClassrooms...${NC}"
|
||||
cd ~/Lessons && git clone ssh://flyingscorpio@2px.info.tm/~/repos/OpenClassrooms.git
|
||||
fi
|
||||
|
||||
echo "Setting up Keepass..."
|
||||
if [ -e ~/Keepass ]; then
|
||||
echo "${GREEN}Keepass is already there, updating...${NC}"
|
||||
cd ~/Keepass && git pull
|
||||
else
|
||||
echo "${ORANGE}Cloning new Keepass...${NC}"
|
||||
cd && git clone ssh://flyingscorpio@2px.info.tm/~/repos/Keepass.git
|
||||
fi
|
||||
|
||||
echo "Setting up PersonnalScripts..."
|
||||
if [ -e ~/PersonnalScripts ]; then
|
||||
echo "${GREEN}PersonnalScripts is already there, updating...${NC}"
|
||||
cd ~/PersonnalScripts && git pull
|
||||
else
|
||||
echo "${ORANGE}Cloning new PersonnalScripts...${NC}"
|
||||
cd && git clone ssh://flyingscorpio@2px.info.tm/~/repos/PersonnalScripts.git
|
||||
fi
|
||||
|
||||
echo "Setting up RootMe..."
|
||||
if [ -e ~/RootMe ]; then
|
||||
echo "${GREEN}RootMe is already there, updating...${NC}"
|
||||
cd ~/RootMe && git pull
|
||||
else
|
||||
echo "${ORANGE}Cloning new RootMe...${NC}"
|
||||
cd && git clone ssh://flyingscorpio@2px.info.tm/~/repos/RootMe.git
|
||||
fi
|
||||
|
||||
echo "Setting up SetupCockpit..."
|
||||
if [ -e ~/SetupCockpit ]; then
|
||||
echo "${GREEN}SetupCockpit is already there, updating...${NC}"
|
||||
cd ~/SetupCockpit && git pull
|
||||
else
|
||||
echo "${ORANGE}Cloning new SetupCockpit...${NC}"
|
||||
cd && git clone ssh://flyingscorpio@2px.info.tm/~/repos/SetupCockpit.git
|
||||
fi
|
||||
|
||||
echo "Setting up VimConf..."
|
||||
if [ -e ~/VimConf ]; then
|
||||
echo "${GREEN}VimConf is already there, updating...${NC}"
|
||||
cd ~/VimConf && git pull
|
||||
else
|
||||
echo "${ORANGE}Cloning new VimConf...${NC}"
|
||||
cd && git clone ssh://flyingscorpio@2px.info.tm/~/repos/VimConf.git
|
||||
mkdir ~/Lessons && echo "${ORANGE}Created ~/Lessons${NC}"
|
||||
fi
|
||||
set_up_2px_repo 'E2L' 'Lessons/'
|
||||
set_up_2px_repo 'OpenClassrooms' 'Lessons/'
|
||||
set_up_2px_repo 'Keepass'
|
||||
set_up_2px_repo 'PersonnalScripts'
|
||||
set_up_2px_repo 'RootMe'
|
||||
set_up_2px_repo 'SetupCockpit'
|
||||
set_up_2px_repo 'VimConf'
|
||||
cd ~/VimConf && /bin/bash ~/VimConf/update.sh -o
|
||||
|
||||
# }}}
|
||||
|
@ -79,18 +57,22 @@ cd ~/VimConf && /bin/bash ~/VimConf/update.sh -o
|
|||
# REPOS ON GITLAB {{{
|
||||
|
||||
if [ ! -e ~/SRC ]; then
|
||||
mkdir ~/SRC
|
||||
echo "${ORANGE}Created ~/SRC${NC}"
|
||||
mkdir ~/SRC && echo "${ORANGE}Created ~/SRC${NC}"
|
||||
fi
|
||||
|
||||
echo "Setting up e2li/depydoc..."
|
||||
if [ -e ~/SRC/depydoc ]; then
|
||||
echo "${GREEN}depydoc is already there, updating..${NC}."
|
||||
cd ~/SRC/depydoc && git pull
|
||||
else
|
||||
echo "${ORANGE}Cloning new depydoc...${NC}"
|
||||
cd ~/SRC && git clone https://gitlab.com/e2li/depydoc.git
|
||||
fi
|
||||
set_up_gitlab_repo 'e2li' 'depydoc' 'SRC/'
|
||||
set_up_gitlab_repo 'flyingscorpio' 'BlurMySearches' 'SRC/'
|
||||
set_up_gitlab_repo 'flyingscorpio' 'JsonToPython' 'SRC/'
|
||||
set_up_gitlab_repo 'flyingscorpio' 'MarioSokoban' 'SRC/'
|
||||
set_up_gitlab_repo 'flyingscorpio' 'PythonLocalBlockchain' 'SRC/'
|
||||
set_up_gitlab_repo 'flyingscorpio' 'Roboc-GUI' 'SRC/'
|
||||
set_up_gitlab_repo 'flyingscorpio' 'Roboc-console' 'SRC/'
|
||||
set_up_gitlab_repo 'flyingscorpio' 'ScheduleTimer' 'SRC/'
|
||||
set_up_gitlab_repo 'flyingscorpio' 'SudokuSolver' 'SRC/'
|
||||
set_up_gitlab_repo 'flyingscorpio' 'TicTacToe' 'SRC/'
|
||||
set_up_gitlab_repo 'flyingscorpio' 'TorNoVPN' 'SRC/'
|
||||
set_up_gitlab_repo 'flyingscorpio' 'WhitespaceInterpreter' 'SRC/'
|
||||
set_up_gitlab_repo 'flyingscorpio' 'WikipediaAcronymScraper' 'SRC/'
|
||||
|
||||
echo "Setting up 2px..."
|
||||
if [ -e ~/SRC/2px ]; then
|
||||
|
@ -111,24 +93,6 @@ export DJANGO_SECRET_KEY
|
|||
systemctl start mysqld.service" >> ~/SRC/2px/env/bin/activate
|
||||
fi
|
||||
|
||||
echo "Setting up BlurMySearches..."
|
||||
if [ -e ~/SRC/BlurMySearches ]; then
|
||||
echo "${GREEN}BlurMySearches is already there, updating...${NC}"
|
||||
cd ~/SRC/BlurMySearches && git pull
|
||||
else
|
||||
echo "${ORANGE}Cloning new BlurMySearches...${NC}"
|
||||
cd ~/SRC && git clone https://gitlab.com/flyingscorpio/BlurMySearches.git
|
||||
fi
|
||||
|
||||
echo "Setting up JsonToPython...${NC}"
|
||||
if [ -e ~/SRC/JsonToPython ]; then
|
||||
echo "${GREEN}JsonToPython is already there, updating...${NC}"
|
||||
cd ~/SRC/JsonToPython && git pull
|
||||
else
|
||||
echo "${ORANGE}Cloning new JsonToPython...${NC}"
|
||||
cd ~/SRC && git clone https://gitlab.com/flyingscorpio/JsonToPython.git
|
||||
fi
|
||||
|
||||
echo "Setting up LVEL-website..."
|
||||
if [ -e ~/SRC/LVEL-website ]; then
|
||||
echo "${GREEN}LVEL-website is already there, updating...${NC}"
|
||||
|
@ -148,94 +112,4 @@ export DJANGO_SECRET_KEY
|
|||
systemctl start mysqld.service" >> ~/SRC/LVEL-website/env/bin/activate
|
||||
fi
|
||||
|
||||
echo "Setting up MarioSokoban..."
|
||||
if [ -e ~/SRC/MarioSokoban ]; then
|
||||
echo "${GREEN}MarioSokoban is already there, updating...${NC}"
|
||||
cd ~/SRC/MarioSokoban && git pull
|
||||
else
|
||||
echo "${ORANGE}Cloning new MarioSokoban...${NC}"
|
||||
cd ~/SRC && git clone https://gitlab.com/flyingscorpio/MarioSokoban.git
|
||||
fi
|
||||
|
||||
echo "Setting up PythonLocalBlockchain..."
|
||||
if [ -e ~/SRC/PythonLocalBlockchain ]; then
|
||||
echo "${GREEN}PythonLocalBlockchain is already there, updating...${NC}"
|
||||
cd ~/SRC/PythonLocalBlockchain && git pull
|
||||
else
|
||||
echo "${ORANGE}Cloning new PythonLocalBlockchain...${NC}"
|
||||
cd ~/SRC && git clone https://gitlab.com/flyingscorpio/PythonLocalBlockchain.git
|
||||
fi
|
||||
|
||||
echo "Setting up Roboc-GUI..."
|
||||
if [ -e ~/SRC/Roboc-GUI ]; then
|
||||
echo "${GREEN}Roboc-GUI is already there, updating...${NC}"
|
||||
cd ~/SRC/Roboc-GUI && git pull
|
||||
else
|
||||
echo "${ORANGE}Cloning new Roboc-GUI...${NC}"
|
||||
cd ~/SRC && git clone https://gitlab.com/flyingscorpio/Roboc-GUI.git
|
||||
fi
|
||||
|
||||
echo "Setting up Roboc-console..."
|
||||
if [ -e ~/SRC/Roboc-console ]; then
|
||||
echo "${GREEN}Roboc-console is already there, updating...${NC}"
|
||||
cd ~/SRC/Roboc-console && git pull
|
||||
else
|
||||
echo "${ORANGE}Cloning new Roboc-console...${NC}"
|
||||
cd ~/SRC && git clone https://gitlab.com/flyingscorpio/Roboc-console.git
|
||||
fi
|
||||
|
||||
echo "Setting up ScheduleTimer..."
|
||||
if [ -e ~/SRC/ScheduleTimer ]; then
|
||||
echo "${GREEN}ScheduleTimer is already there, updating...${NC}"
|
||||
cd ~/SRC/ScheduleTimer && git pull
|
||||
else
|
||||
echo "${ORANGE}Cloning new ScheduleTimer...${NC}"
|
||||
cd ~/SRC && git clone https://gitlab.com/flyingscorpio/ScheduleTimer.git
|
||||
fi
|
||||
|
||||
echo "Setting up SudokuSolver..."
|
||||
if [ -e ~/SRC/SudokuSolver ]; then
|
||||
echo "${GREEN}SudokuSolver is already there, updating...${NC}"
|
||||
cd ~/SRC/SudokuSolver && git pull
|
||||
else
|
||||
echo "${ORANGE}Cloning new SudokuSolver...${NC}"
|
||||
cd ~/SRC && git clone https://gitlab.com/flyingscorpio/SudokuSolver.git
|
||||
fi
|
||||
|
||||
echo "Setting up TicTacToe..."
|
||||
if [ -e ~/SRC/TicTacToe ]; then
|
||||
echo "${GREEN}TicTacToe is already there, updating...${NC}"
|
||||
cd ~/SRC/TicTacToe && git pull
|
||||
else
|
||||
echo "${ORANGE}Cloning new TicTacToe...${NC}"
|
||||
cd ~/SRC && git clone https://gitlab.com/flyingscorpio/TicTacToe.git
|
||||
fi
|
||||
|
||||
echo "Setting up TorNoVPN..."
|
||||
if [ -e ~/SRC/TorNoVPN ]; then
|
||||
echo "${GREEN}TorNoVPN is already there, updating...${NC}"
|
||||
cd ~/SRC/TorNoVPN && git pull
|
||||
else
|
||||
echo "${ORANGE}Cloning new TorNoVPN...${NC}"
|
||||
cd ~/SRC && git clone https://gitlab.com/flyingscorpio/TorNoVPN.git
|
||||
fi
|
||||
|
||||
echo "Setting up WhitespaceInterpreter..."
|
||||
if [ -e ~/SRC/WhitespaceInterpreter ]; then
|
||||
echo "${GREEN}WhitespaceInterpreter is already there, updating...${NC}"
|
||||
cd ~/SRC/WhitespaceInterpreter && git pull
|
||||
else
|
||||
echo "${ORANGE}Cloning new WhitespaceInterpreter...${NC}"
|
||||
cd ~/SRC && git clone https://gitlab.com/flyingscorpio/WhitespaceInterpreter.git
|
||||
fi
|
||||
|
||||
echo "Setting up WikipediaAcronymScraper..."
|
||||
if [ -e ~/SRC/WikipediaAcronymScraper ]; then
|
||||
echo "${GREEN}WikipediaAcronymScraper is already there, updating...${NC}"
|
||||
cd ~/SRC/WikipediaAcronymScraper && git pull
|
||||
else
|
||||
echo "${ORANGE}Cloning new WikipediaAcronymScraper...${NC}"
|
||||
cd ~/SRC && git clone https://gitlab.com/flyingscorpio/WikipediaAcronymScraper.git
|
||||
fi
|
||||
|
||||
# }}}
|
||||
|
|
Loading…
Add table
Reference in a new issue