-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCode
31 lines (28 loc) · 902 Bytes
/
Code
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
function code {
if [[ $# = 0 ]]
then
open -a "Visual Studio Code"
else
local argPath="$1"
[[ $1 = /* ]] && argPath="$1" || argPath="$PWD/${1#./}"
open -a "Visual Studio Code" "$argPath"
fi
}
function create {
echo "Automatic React Git Repo"
if [ "$2" = "private" ]; then
curl -H "Authorization: token YOUR_GITHUB_ACCESS_TOKEN" --data '{"name": "'"$1"'", "private": "true", "visibility": "private"}' https://api.github.com/user/repos
else
curl -H "Authorization: token YOUR_GITHUB_ACCESS_TOKEN" --data '{"name": "'"$1"'"}' https://api.github.com/user/repos
fi
cd ~/Desktop/Projects/
git clone https://github.com/YOUR_USERNAME/$1.git
cd ~/Desktop/Projects/$1
npx create-react-app client
git add .
git commit -m 'first auto commit'
git push
cd client/src
code .
}
alias create="create"