From 88e5d9c82248cccf9c0bb2f18908ae319871e925 Mon Sep 17 00:00:00 2001 From: Marco Micera Date: Mon, 20 Feb 2023 23:33:34 +0100 Subject: [PATCH 1/7] Added Makefile target and base script --- Makefile | 5 +++++ scripts/install.zsh | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100755 scripts/install.zsh diff --git a/Makefile b/Makefile index 036ac1b..cd85459 100644 --- a/Makefile +++ b/Makefile @@ -27,6 +27,11 @@ ifeq ($(NO_GIT_INFO),) $(MAKE) diff endif +.PHONY: install +.SILENT: install +install: + $(SCRIPTS)/install.zsh + .PHONY: status .SILENT: status status: diff --git a/scripts/install.zsh b/scripts/install.zsh new file mode 100755 index 0000000..6cf48e9 --- /dev/null +++ b/scripts/install.zsh @@ -0,0 +1,37 @@ +#!/usr/bin/env zsh + +set -e + +# This repo's absolute path +CWD="$( + cd -- "$(dirname "$0")" >/dev/null 2>&1 || exit + realpath $(pwd -P)/.. +)" + +# This folder absolute path +SCRIPTS="$( + cd -- "$(dirname "$0")" >/dev/null 2>&1 || exit + pwd -P +)" + +# Including utils +UTILS_DIR="${SCRIPTS}"/util +if [ -d "${UTILS_DIR}" ]; then + for utility_file in "${UTILS_DIR}"/*.sh + do + test -x "${utility_file}" && source "${utility_file}" + done +else + echo "Utility folder ${UTILS_DIR} does not exist. Terminating..." + exit 1 +fi + +# Asking the user again +echo -n "Installing files: do you want to continue? [y/N]: " +read answer +if [[ "$answer" != [yY] ]]; then + echo "Aborting script." + exit 1 +fi + + From 768221c2821a68b0cb4c7c889e277507bfb5c34d Mon Sep 17 00:00:00 2001 From: Marco Micera Date: Mon, 20 Feb 2023 23:42:49 +0100 Subject: [PATCH 2/7] Installing Ruby gems --- scripts/install.zsh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/scripts/install.zsh b/scripts/install.zsh index 6cf48e9..904622a 100755 --- a/scripts/install.zsh +++ b/scripts/install.zsh @@ -34,4 +34,15 @@ if [[ "$answer" != [yY] ]]; then exit 1 fi - +# Ruby +magenta "Ruby" +( + while read -r gem + do + # Install the gem using the gem install command + ( + set -x + gem install --user-install "${gem}" || echo "Failed to install gem: $gem" + ) + done < "${CWD}"/gems +) From 3e3e76d115546fc10aef2fa5ba48275ab5d98373 Mon Sep 17 00:00:00 2001 From: Marco Micera Date: Mon, 20 Feb 2023 23:49:30 +0100 Subject: [PATCH 3/7] Installing `asdf` plugins --- scripts/install.zsh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/install.zsh b/scripts/install.zsh index 904622a..345ccbd 100755 --- a/scripts/install.zsh +++ b/scripts/install.zsh @@ -46,3 +46,11 @@ magenta "Ruby" ) done < "${CWD}"/gems ) + +# asdf +magenta "asdf" +( + while read -r plugin; do + asdf plugin-add "${plugin}" || true + done < "${CWD}"/asdf/list.txt +) From 2e49360a9db1fcc2515c246c12b8e70cf14f8da9 Mon Sep 17 00:00:00 2001 From: Marco Micera Date: Mon, 20 Feb 2023 23:50:24 +0100 Subject: [PATCH 4/7] Fixed spacing while importing `asdf` plugins --- scripts/import.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/import.zsh b/scripts/import.zsh index 7b49667..8218ca4 100755 --- a/scripts/import.zsh +++ b/scripts/import.zsh @@ -39,7 +39,7 @@ magenta "Ruby" magenta "asdf" ( set -x - asdf plugin list >"${CWD}"/asdf/list.txt + asdf plugin list > "${CWD}"/asdf/list.txt ) # brew From ca6a87f7ab3325e28a4e296bbec0ab498b9ad4d4 Mon Sep 17 00:00:00 2001 From: Marco Micera Date: Mon, 20 Feb 2023 23:52:45 +0100 Subject: [PATCH 5/7] Installing `asfd` global binaries --- scripts/install.zsh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/install.zsh b/scripts/install.zsh index 345ccbd..1c3019c 100755 --- a/scripts/install.zsh +++ b/scripts/install.zsh @@ -50,7 +50,11 @@ magenta "Ruby" # asdf magenta "asdf" ( + # Plugins while read -r plugin; do asdf plugin-add "${plugin}" || true done < "${CWD}"/asdf/list.txt + + # Global binaries + popd "${CWD}"/asdf && asdf install ) From 24fd4951669ca8119c3a083c7bd7854e005c7965 Mon Sep 17 00:00:00 2001 From: Marco Micera Date: Mon, 20 Feb 2023 23:54:23 +0100 Subject: [PATCH 6/7] Updated list of Ruby gems --- gems | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/gems b/gems index b9c7df1..59b88e2 100644 --- a/gems +++ b/gems @@ -1,44 +1,62 @@ +addressable bigdecimal bundler +CFPropertyList +clocale cmath +colorls csv date dbm did_you_mean +do e2mmap etc fcntl fiddle +filesize fileutils forwardable io-console ipaddr irb json +libxml-ruby logger +manpages matrix +mini_portile2 minitest mutex_m +net-sftp +net-ssh net-telnet +nokogiri openssl ostruct power_assert prime psych +public_suffix +racc +rainbow rake rdoc +reline rexml rss -rubygems-update scanf sdbm shell +singleton +sqlite3 stringio strscan sync test-unit thwait tracer +unicode-display_width webrick xmlrpc zlib From 56049bd907979f2e85b1c499b71b3b0f991bdb68 Mon Sep 17 00:00:00 2001 From: Marco Micera Date: Tue, 21 Feb 2023 10:51:01 +0100 Subject: [PATCH 7/7] Fixed gpg conf with new `pinentry-mac` location --- .gnupg/gpg-agent.conf | 2 +- zsh/.functions | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.gnupg/gpg-agent.conf b/.gnupg/gpg-agent.conf index d9704a5..646e6c8 100644 --- a/.gnupg/gpg-agent.conf +++ b/.gnupg/gpg-agent.conf @@ -1 +1 @@ -pinentry-program /usr/local/bin/pinentry-mac +pinentry-program /opt/homebrew/bin/pinentry-mac diff --git a/zsh/.functions b/zsh/.functions index 01fe7ef..346107c 100644 --- a/zsh/.functions +++ b/zsh/.functions @@ -59,3 +59,7 @@ function today() { function gitconfig() { <<< $(cat ~/.ssh/.gitconfig-"${1}") < ./.git/config | sponge ./.git/config } + +function restartgpg() { + pkill -9 gpg-agent +}