-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup-github.sh
More file actions
78 lines (70 loc) · 2.21 KB
/
setup-github.sh
File metadata and controls
78 lines (70 loc) · 2.21 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/bin/bash
# GitHub Setup Script for Linux/Mac
echo "========================================="
echo " GitHub Setup for Interviewer Agent"
echo "========================================="
echo ""
# Check if GitHub CLI is installed
if ! command -v gh &> /dev/null; then
echo "GitHub CLI (gh) is not installed."
echo ""
echo "Install GitHub CLI:"
echo " Mac: brew install gh"
echo " Linux: https://github.com/cli/cli/blob/trunk/docs/install_linux.md"
echo ""
exit 1
fi
echo "Checking GitHub authentication..."
if ! gh auth status &> /dev/null; then
echo ""
echo "Not authenticated with GitHub."
echo "Starting authentication process..."
echo ""
gh auth login --hostname github.com
fi
echo ""
echo "========================================="
echo " Creating GitHub Repository"
echo "========================================="
echo ""
# Ask for repository name
read -p "Enter repository name (default: intervieweragent): " REPO_NAME
REPO_NAME=${REPO_NAME:-intervieweragent}
# Ask for repository visibility
echo ""
echo "Repository visibility:"
echo "1. public (anyone can view, recommended for open source)"
echo "2. private (only you can view)"
echo ""
read -p "Choose (1=public, 2=private) [default: public]: " VISIBILITY
if [ "$VISIBILITY" = "2" ]; then
VIS_ARG="--private"
else
VIS_ARG="--public"
fi
echo ""
echo "Creating repository: $REPO_NAME ..."
gh repo create "$REPO_NAME" $VIS_ARG --source=. --remote=origin --push
if [ $? -eq 0 ]; then
echo ""
echo "========================================="
echo " Setup Complete!"
echo "========================================="
echo ""
echo "Your repository is now live at:"
echo "https://github.com/$(gh api user | jq -r '.login')/$REPO_NAME"
echo ""
echo "Next steps:"
echo "1. Visit the repository URL above"
echo "2. Add repository description and topics"
echo "3. Consider adding a LICENSE file"
echo ""
else
echo ""
echo "Repository creation failed."
echo "It may already exist. Try connecting existing repo:"
echo ""
echo " git remote add origin https://github.com/\$(gh api user | jq -r '.login')/$REPO_NAME.git"
echo " git push -u origin main"
echo ""
fi