-
-
Save Su-Shee/9452809eef287d7f0f60 to your computer and use it in GitHub Desktop.
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 | |
# installs plenv, perl, carton, cpanminus, sets up environment in .bash_profile | |
# from https://github.com/tokuhirom/plenv#readme | |
PLENV_PERL_VERSION='5.20.2' | |
if [[ -n "$PERL_MB_OPT" ]]; then | |
echo "You must unset your local::lib environment variables first" | |
exit 1 | |
fi | |
echo " - Building perl environment -" | |
# get plenv latest | |
echo " + Cloning latest plenv..." | |
git clone git://github.com/tokuhirom/plenv.git ~/.plenv | |
echo " + Updating .bashrc with plenv bin and perl binary shims..." | |
PLENV_PATH='export PATH="$HOME/.plenv/bin:$PATH"' | |
PLENV_INIT='eval "$(plenv init -)"' | |
echo $PLENV_PATH >> ~/.bashrc # add plenv to path | |
echo $PLENV_INIT >> ~/.bashrc # shims and autocomplete | |
# make the above available for the rest of this script | |
eval $PLENV_PATH | |
eval $PLENV_INIT | |
echo " + Cloning perl-build..." | |
git clone git://github.com/tokuhirom/Perl-Build.git ~/.plenv/plugins/perl-build/ | |
echo " + Building perl ${PLENV_PERL_VERSION}..." | |
plenv install $PLENV_PERL_VERSION -Dusethreads | |
echo " + Switching to $PLENV_PERL_VERSION" | |
plenv local $PLENV_PERL_VERSION | |
echo " + Installing cpanminus..." | |
plenv install-cpanm | |
echo " + Installing carton..." | |
cpanm Carton | |
echo "plenv installation complete!" | |
echo " + Initializing and using plenv..." | |
exec $SHELL -l |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment