-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup_github.sh
More file actions
executable file
Β·38 lines (31 loc) Β· 1.11 KB
/
Copy pathsetup_github.sh
File metadata and controls
executable file
Β·38 lines (31 loc) Β· 1.11 KB
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
# Script to set up GitHub repository for SensorShare3
# This script will help you create and push to GitHub
echo "π Setting up GitHub repository for SensorShare3..."
echo ""
# Check if GitHub CLI is installed
if ! command -v gh &> /dev/null; then
echo "β GitHub CLI (gh) is not installed."
echo " Please install it first or follow the manual instructions below."
exit 1
fi
# Check if authenticated
if ! gh auth status &> /dev/null; then
echo "π You need to authenticate with GitHub first."
echo " Running: gh auth login"
echo ""
gh auth login
echo ""
fi
# Create the repository
echo "π¦ Creating GitHub repository 'SensorShare3'..."
gh repo create SensorShare3 --public --source=. --remote=origin --push
if [ $? -eq 0 ]; then
echo ""
echo "β
Repository created and code pushed successfully!"
echo "π Your repository is available at: https://github.com/$(gh api user --jq .login)/SensorShare3"
else
echo ""
echo "β οΈ Repository might already exist or there was an error."
echo " You can manually push with: git push -u origin master"
fi