mirror of
https://github.com/Snigdha-OS/snigdhaos-arctic.git
synced 2025-09-20 19:45:01 +02:00
🐞 fix(_blank): minimal script
This commit is contained in:
48
config.sh
48
config.sh
@@ -5,43 +5,17 @@
|
|||||||
|
|
||||||
# NOTE : Run at your own Risk!
|
# NOTE : Run at your own Risk!
|
||||||
|
|
||||||
# Function to print GitHub credential configuration options
|
# Prompt user for GitHub username
|
||||||
print_options() {
|
read -p "Enter your GitHub username: " GITHUB_USERNAME
|
||||||
echo "🔒 Configure GitHub Credentials:"
|
|
||||||
echo "1. 📝 Enter GitHub username and password"
|
|
||||||
echo "2. 🔑 Enter GitHub personal access token"
|
|
||||||
echo "3. 📁 Use existing GitHub credentials from ~/.gitconfig"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Print options and prompt user to select
|
# Prompt user for GitHub email
|
||||||
print_options
|
read -p "Enter your GitHub email: " GITHUB_EMAIL
|
||||||
echo "Enter the number of your chosen option:"
|
|
||||||
read -r OPTION
|
|
||||||
|
|
||||||
# Handle user selection
|
# Set the global Git configuration for username and email
|
||||||
case $OPTION in
|
git config --global user.name "$GITHUB_USERNAME"
|
||||||
1)
|
git config --global user.email "$GITHUB_EMAIL"
|
||||||
echo "Enter your GitHub username:"
|
|
||||||
read -r USERNAME
|
|
||||||
echo "Enter your GitHub password:"
|
|
||||||
read -s PASSWORD
|
|
||||||
git config --global credential.helper store
|
|
||||||
git config --global credential.username $USERNAME
|
|
||||||
git config --global credential.password $PASSWORD
|
|
||||||
;;
|
|
||||||
2)
|
|
||||||
echo "Enter your GitHub personal access token:"
|
|
||||||
read -r TOKEN
|
|
||||||
git config --global credential.helper store
|
|
||||||
git config --global credential.username "your-github-username"
|
|
||||||
git config --global credential.password $TOKEN
|
|
||||||
;;
|
|
||||||
3)
|
|
||||||
echo "Using existing GitHub credentials from ~/.gitconfig"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Invalid option. Exiting."
|
|
||||||
exit 1;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
echo "GitHub credentials configured successfully! 👍"
|
# Confirm the changes
|
||||||
|
echo "GitHub username and email have been configured:"
|
||||||
|
git config --global user.name
|
||||||
|
git config --global user.email
|
||||||
|
Reference in New Issue
Block a user