Skip to content

Instantly share code, notes, and snippets.

@0b1kn00b
Created October 22, 2024 10:30
Show Gist options
  • Save 0b1kn00b/3dbef7abc8f2b64465b08496af06bae3 to your computer and use it in GitHub Desktop.
Save 0b1kn00b/3dbef7abc8f2b64465b08496af06bae3 to your computer and use it in GitHub Desktop.
direnv code for installing https://github.com/zyedidia/eget
is_unixy=true
do_install=false
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
if ! type "eget" > /dev/null; then
echo "not installed"
do_install=true
fi
elif [[ "$OSTYPE" == "darwin"* ]]; then
# Mac OSX
if ! type "eget" > /dev/null; then
do_install=true
fi
elif [[ "$OSTYPE" == "cygwin" ]]; then
# POSIX compatibility layer and Linux environment emulation for Windows
if ! type "eget" > /dev/null; then
do_install=true
fi
elif [[ "$OSTYPE" == "msys" ]]; then
# Lightweight shell and GNU utilities compiled for Windows (part of MinGW)
if ! type "eget" > /dev/null; then
do_install=true
fi
elif [[ "$OSTYPE" == "win32" ]]; then
# I'm not sure this can happen.
value=$(cmd /c "(help eget > nul || exit 0) && where eget > nul 2> nul")
if value; then
do_install=true
fi
elif [[ "$OSTYPE" == "freebsd"* ]]; then
if ! type "eget" > /dev/null; then
do_install=true
fi
else
echo "ERROR: unknown platform" >&2
exit -1
fi
if $do_install; then
if $is_unixy; then
curl https://zyedidia.github.io/eget.sh | sh
echo "moving to /usr/bin"
if type "sudo" > /dev/null; then
sudo mv ./eget /usr/bin
else
mv ./eget /usr/bin
fi
else
choco install eget
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment