Skip to content

Instantly share code, notes, and snippets.

View anthonygedeon's full-sized avatar

Anthony Gedeon anthonygedeon

View GitHub Profile
@anthonygedeon
anthonygedeon / nvmrc
Last active December 18, 2021 22:23
automagically update node version when changing into a new directory
#!/usr/bin/env bash
old_version=$(nvm current)
cd() {
builtin cd "$@" || exit
if [[ -e .nvmrc ]]; then
nvm use "$(cut -c 2- .nvmrc)"
else