-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.sh
37 lines (29 loc) · 868 Bytes
/
run.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
#!/bin/bash
#############
# File name: run.sh
# Purpose: When executed, this will:
# 1. Clear any previous COE_211 repos present
# 2. Fetch the COE_211 repo from the provided GitHub username
# This code will create and delete repos within the directory it runs in
# Created by: Christophe El-Khoury (thelebdev)
# Created at: 22-02-2022, Byblos - Lebanon
###########
# User's input, GitHub handle
GITHUB_HANDLE=$1
# Path of folder to be deleted
DELETE_PATH="COE_211"
# Path where repo will be created
CREATE_PATH=""
# If code is executed without inputting a handle
if [ -z $GITHUB_HANDLE ]
then
echo "Please make sure to provide a GitHub handle"
exit 0
fi
# Fetching
GIT_URL="[email protected]:"$GITHUB_HANDLE"/COE_211.git"
echo "Cloning $GIT_URL into $GITHUB_HANDLE"
git clone $GIT_URL $GITHUB_HANDLE
echo "Opening cloned repo"
code $GITHUB_HANDLE
echo "Done"