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/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/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 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 diff --git a/scripts/install.zsh b/scripts/install.zsh new file mode 100755 index 0000000..1c3019c --- /dev/null +++ b/scripts/install.zsh @@ -0,0 +1,60 @@ +#!/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 + +# 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 +) + +# 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 +) 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 +}