Auto Git Config Script Added and Tab_Data TOML Updated.#448
Auto Git Config Script Added and Tab_Data TOML Updated.#448fam007e wants to merge 10 commits intoChrisTitusTech:mainfrom fam007e:feature/git-auto-conf-cli
Conversation
…b_data toml file.
koibtw
left a comment
There was a problem hiding this comment.
You should move this to utils/
| # Prompt user to confirm they've added the key to GitHub | ||
| while true; do | ||
| printf "Have you pasted your SSH public key into your GitHub account? (y/n): " | ||
| read yn | ||
| case "$yn" in | ||
| [Yy]* ) echo "Proceeding..."; break ;; | ||
| [Nn]* ) echo "Please paste your SSH public key into GitHub and try again."; exit ;; | ||
| * ) echo "Please answer yes (y) or no (n)." ;; | ||
| esac | ||
| done | ||
|
|
||
| # Test the SSH connection with GitHub | ||
| ssh -T git@github.com | ||
| } |
There was a problem hiding this comment.
I don't know if this GitHub part is neccessary. @nnyyxxxx ?
There was a problem hiding this comment.
the users dont know if the information they're putting into linutil is being tracked or not without looking at the source code so this is bad @fam007e
There was a problem hiding this comment.
But as far as I know linutil is binary running in user's specific environment so text being in user's clipboard is NOT supposed be an issue here.
Since you have raised an issue I will change it anyway unlike what my opinion is on this matter.
|
Your script should also check if |
Co-authored-by: Adam Perkowski <adas1per@protonmail.com>
Co-authored-by: Adam Perkowski <adas1per@protonmail.com>
Co-authored-by: Adam Perkowski <adas1per@protonmail.com>
|
@fam007e Can you draft this PR for now (and the other ones as well)? Chris is going to be streaming soon and with almost 60 open PRs let's just not waste his time before this is done. |
|
Yeah i'm going to just say it now, THIS PR is a total mess; and a joke, you're using functions in common-script that shouldn't be used for checking deps like curl or git, and on top of that you're asking the user if they want to test their GIT SSH key which is sooo invasive. Please just close this. |
tabs/utils/git-auto-conf-cli.sh
Outdated
| else | ||
| echo "Skipping passphrase setup." | ||
| fi | ||
| echo "SSH key generation and setup completed.\nPlease copy the key from your ssh dir and paste it to your corresponding account ssh key add section of your github settings page.\nThen run this command to verify ssh connection:\nssh -T git@github.com" |
There was a problem hiding this comment.
| echo "SSH key generation and setup completed.\nPlease copy the key from your ssh dir and paste it to your corresponding account ssh key add section of your github settings page.\nThen run this command to verify ssh connection:\nssh -T git@github.com" | |
| printf "SSH key generation and setup completed.\nPlease copy the key from your ssh dir and paste it to your corresponding account ssh key add section of your github settings page.\nThen run this command to verify ssh connection:\nssh -T git@github.com" |
You CANNOT use new lines in echo without it being non-posix, use printf
But @adamperkowski told me to add deps check for git... 🙃 |
…oved to utils dir as a concsequence affected tabs TOML is edited
And I'm telling you that your implementation is wrong 👎 |
tabs/utils/git-auto-conf-cli.sh
Outdated
|
|
||
| # Function to prompt for GitHub configuration | ||
| setup_git_config() { | ||
| checkCommandRequirements "git" |
There was a problem hiding this comment.
Yeah this implementation is completely WRONG, you clearly do not know what you're doing, using "checkcommandrequirements" from common script will exit the script if git is not found which is BAD and should not be used in this SCENARIO 👎
|
Draft these PRs they are not ready in the slightest. |
| [[data]] | ||
| name = "Remove Snaps" | ||
| script = "4-remove-snaps.sh" | ||
|
|
There was a problem hiding this comment.
@fam007e ONCE AGAIN, this extra line has not been removed, please remove it
tabs/utils/git-auto-conf-cli.sh
Outdated
|
|
||
| # Main execution | ||
| checkEnv | ||
| checkCommandRequirements "git" |
There was a problem hiding this comment.
NO. This implementation is STILL wrong, what do you not understand? I explained it to you in a previous review; Exiting the script if git is not found is NOT good. Do not implement it like this...
tabs/utils/git-auto-conf-cli.sh
Outdated
|
|
||
| # Main execution | ||
| checkEnv | ||
| checkCommandRequirements "git" |
tabs/utils/git-auto-conf-cli.sh
Outdated
|
|
||
| # Main execution | ||
| checkEnv | ||
| checkCommandRequirements "git" |
There was a problem hiding this comment.
@fam007e The other review on this issue is NOT resolved, I don't understand what you do not understand this implementation is incorrect and will exit the script upon git not being found, this is not what we want. Seriously dude.. We have tried explaining to you many times over.
tabs/utils/git-auto-conf-cli.sh
Outdated
| printf "Choose your SSH key type:" | ||
| printf "1. Ed25519 (recommended)" | ||
| printf "2. RSA (legacy)" | ||
| printf "Enter your choice (1 or 2): " |
There was a problem hiding this comment.
Not like that. This is how it looks with printfs:
Choose your SSH key type:1. Ed25519 (recommended)2. RSA (legacy)Enter your choice (1 or 2):
| printf "Choose your SSH key type:" | |
| printf "1. Ed25519 (recommended)" | |
| printf "2. RSA (legacy)" | |
| printf "Enter your choice (1 or 2): " | |
| echo "Choose your SSH key type:" | |
| echo "1. Ed25519 (recommended)" | |
| echo "2. RSA (legacy)" | |
| printf "Enter your choice (1 or 2): " |
tabs/utils/git-auto-conf-cli.sh
Outdated
| 1) key_algo="ed25519" ;; | ||
| 2) key_algo="rsa" ;; | ||
| *) | ||
| printf "Invalid choice. Exiting." |
There was a problem hiding this comment.
| printf "Invalid choice. Exiting." | |
| echo "Invalid choice. Exiting." |
| printf "Do you want to use a passphrase? (y/n): " | ||
| read use_passphrase | ||
|
|
||
| # If user opts for a passphrase, add key to SSH agent | ||
| if [ "$use_passphrase" = "y" ]; then | ||
| ssh-add -l >/dev/null 2>&1 || eval "$(ssh-agent -s)" | ||
| ssh-add "$ssh_key_path" | ||
| else | ||
| printf "Skipping passphrase setup." | ||
| fi |
There was a problem hiding this comment.
| printf "Do you want to use a passphrase? (y/n): " | |
| read use_passphrase | |
| # If user opts for a passphrase, add key to SSH agent | |
| if [ "$use_passphrase" = "y" ]; then | |
| ssh-add -l >/dev/null 2>&1 || eval "$(ssh-agent -s)" | |
| ssh-add "$ssh_key_path" | |
| else | |
| printf "Skipping passphrase setup." | |
| fi | |
| printf "Do you want to use a passphrase? (Y/n): " | |
| read use_passphrase | |
| case "$use_passphrase" in | |
| n|N) | |
| echo "Skipping passphrase setup." | |
| ;; | |
| *) | |
| ssh-add -l >/dev/null 2>&1 || eval "$(ssh-agent -s)" | |
| ssh-add "$ssh_key_path" | |
| ;; | |
| esac |
tabs/utils/git-auto-conf-cli.sh
Outdated
| else | ||
| printf "Skipping passphrase setup." | ||
| fi | ||
| printf "SSH key generation and setup completed.\nPlease copy the key from your ssh dir and paste it to your corresponding account ssh key add section of your github settings page.\nThen run this command to verify ssh connection:\nssh -T git@github.com" |
There was a problem hiding this comment.
| printf "SSH key generation and setup completed.\nPlease copy the key from your ssh dir and paste it to your corresponding account ssh key add section of your github settings page.\nThen run this command to verify ssh connection:\nssh -T git@github.com" | |
| printf "SSH key generation and setup completed.\nPlease copy the key from your ssh dir and paste it to your corresponding account ssh key add section of your github settings page.\nThen run this command to verify ssh connection:\nssh -T git@github.com\n" |
|
Draft this until everything is done. |
Plz check the recent commit. Hopefully I did not mess this up. |
Yeah.. you're creating more problems and it's being implemented incorrectly. |
|
@fam007e Is this a joke? |

Type of Change
Description
This PR introduces a script that automates the configuration of Git for users, allowing them to:
Additionally, it includes consequential changes to the
tab_data.tomlfile for proper integration.Testing
Impact
This change simplifies the Git setup process, ensuring consistency across environments and making it easier for users to configure their Git and GitHub SSH keys.
Issue related to PR
system-setuppart of Linutil. #307Checklist