Last active
December 11, 2023 00:53
-
-
Save ser1zw/3c34f7ebe18214f2696dc0548198c8d2 to your computer and use it in GitHub Desktop.
update-allenv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import os | |
import subprocess | |
HOMEDIR = os.getenv('HOME') | |
GIT_COMMAND = 'git pull --rebase origin master' | |
git_clone_dirs = ['.rbenv', '.rbenv/plugins/ruby-build', '.pyenv'] | |
brew_commands = ['perlbrew self-upgrade', 'perlbrew -f install-cpanm', 'nodebrew selfupdate'] | |
for dir in [HOMEDIR + '/' + d for d in git_clone_dirs]: | |
os.chdir(dir) | |
s = subprocess.check_output(GIT_COMMAND.split(' ')).strip() | |
print(s.decode()) | |
for c in brew_commands: | |
s = subprocess.check_output(c.split(' ')).strip() | |
print(s.decode()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -euo pipefail | |
GIT_PULL_DIRS=$(cat <<EOS | |
/home/seri/.rbenv | |
/home/seri/.rbenv/plugins/ruby-build | |
/home/seri/.pyenv | |
EOS | |
) | |
SPECIFIC_UPGRADE_COMMANDS=$(cat <<EOS | |
nodebrew selfupdate | |
EOS | |
) | |
for dir in $(echo ${GIT_PULL_DIRS}); do | |
( | |
cd ${dir} | |
git pull --rebase origin $(git branch --show-current) | |
) | |
done | |
IFS=$'\n' | |
for cmd in $(echo ${SPECIFIC_UPGRADE_COMMANDS}); do | |
/bin/bash -c ${cmd} | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment