Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install support #20

Draft
wants to merge 7 commits into
base: zsh
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gnupg/gpg-agent.conf
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pinentry-program /usr/local/bin/pinentry-mac
pinentry-program /opt/homebrew/bin/pinentry-mac
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ ifeq ($(NO_GIT_INFO),)
$(MAKE) diff
endif

.PHONY: install
.SILENT: install
install:
$(SCRIPTS)/install.zsh

.PHONY: status
.SILENT: status
status:
Expand Down
20 changes: 19 additions & 1 deletion gems
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion scripts/import.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
60 changes: 60 additions & 0 deletions scripts/install.zsh
Original file line number Diff line number Diff line change
@@ -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
)
4 changes: 4 additions & 0 deletions zsh/.functions
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,7 @@ function today() {
function gitconfig() {
<<< $(cat ~/.ssh/.gitconfig-"${1}") < ./.git/config | sponge ./.git/config
}

function restartgpg() {
pkill -9 gpg-agent
}