Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- urlencode() {
- # urlencode <string>
- old_lc_collate=$LC_COLLATE
- LC_COLLATE=C
- local length="${#1}"
- for (( i = 0; i < length; i++ )); do
- local c="${1:i:1}"
- case $c in
- [a-zA-Z0-9.~_-]) printf "$c" ;;
- *) printf '%%%02X' "'$c" ;;
- esac
- done
- LC_COLLATE=$old_lc_collate
- }
- # $1 Display name of the repo
- # $2 Repo name on github
- # $3 Folder in which repo is to be cloned
- clonearepo() {
- printf "Cloning: $1... "
- git clone https://${USERNAME}:${PASSWORD}@github.com/IMGIITRoorkee/${2}.git ${3} &> /dev/null
- printf "done\n"
- cd ${3}
- git remote set-url origin https://github.com/IMGIITRoorkee/${2}.git
- cd ..
- }
- read -p "GitHub username: " USERNAME
- read -s -p "GitHub password: " PASSWORD
- PASSWORD=$(urlencode ${PASSWORD})
- echo
- # Check if codebase directory exist and finally opens codebase
- if [ ! -d "codebase" ]; then
- mkdir codebase/
- fi
- cd codebase/
- # Check if codebase directory exist and finally opens codebase
- if [ ! -d "omniport-frontend" ]; then
- rm -rf omniport-frontend
- fi
- # Clone omniport-frontend base directory and open the directory
- clonearepo "Omniport Frontend" "omniport-frontend" "omniport-frontend"
- cd omniport-frontend/omniport/
- # Clone formula_one
- clonearepo "Formula One" "omniport-frontend-formula-one" "formula_one"
- # Clone the services in the services/ directory
- cd services/
- clonearepo "Apps" "omniport-frontend-apps" "apps"
- clonearepo "Auth" "omniport-frontend-auth" "auth"
- clonearepo "Developer" "omniport-frontend-developer" "developer"
- clonearepo "Feed" "omniport-frontend-feed" "feed"
- clonearepo "Groups" "omniport-frontend-groups" "groups"
- clonearepo "Helpcentre" "omniport-frontend-helpcentre" "helpcentre"
- clonearepo "Links" "omniport-frontend-links" "links"
- clonearepo "Oauth" "omniport-frontend-oauth" "oauth"
- clonearepo "Settings" "omniport-frontend-settings" "settings"
- clonearepo "Terms of Use" "omniport-frontend-terms-of-use" "terms_of_use"
- # Add dependencies
- cd ..
- yarn &> /dev/null
Add Comment
Please, Sign In to add comment