Skip to content

Commit

Permalink
feat: add ssh key script
Browse files Browse the repository at this point in the history
  • Loading branch information
YasminTeles committed Mar 6, 2024
1 parent a8e6f88 commit 256e736
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: help del
.PHONY: help del ssh

help: ## Show help.
@printf "A set of development's commands.\n"
Expand All @@ -10,3 +10,8 @@ help: ## Show help.
del: ## delete your environment configuration
@stow --dotfiles -D git
@rm -rf ~/Projects
@rm -rf ~/.ssh/id_ed25519 ~/.ssh/id_ed25519.pub

ssh: ## Copy the SSH public key to your clipboard.
@pbcopy < ~/.ssh/id_ed25519.pub
@echo "Add the SSH public key to your account on GitHub or GiLlab. See your profile settings for more information."
17 changes: 12 additions & 5 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,24 @@
read -p "What is your email? " GIT_EMAIL

print "\nPlease wait! It will configure your environment. \n"
echo "[1/3] Creating the Projects folder..."
echo "[1/4] Creating the Projects folder..."
mkdir ~/Projects

echo "[2/3] Setting up dotfiles..."
echo "[2/4] Setting up dotfiles..."
git clone https://github.com/YasminTeles/dotfiles.git ~/.dotfiles

cd ~/.dotfiles
stow --dotfiles git

echo "[3/3] Configuring Git..."
echo "[3/4] Configuring Git..."
git config --global user.email $GIT_EMAIL

printf "\nSuccess Everythings is ready!"
printf "\nHave a nice day!"
echo "[4/4] Generating a new SSH key..."
rm -rf ~/.ssh/id_ed25519 ~/.ssh/id_ed25519.pub
ssh-keygen -t ed25519 -C $GIT_EMAIL -f ~/.ssh/id_ed25519 -q -N ""
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
echo "Warning: You must add the SSH public key to your account on GitHub or GitLab. For more information, see make ssh"

printf "\nSuccess: Everything is ready!"
printf "\nHave a nice day!\n"

0 comments on commit 256e736

Please sign in to comment.