Get started with plenv

This commit is contained in:
John Mertz 2024-01-31 21:53:28 -07:00
parent 6b5523d58e
commit e964ad2de2
5 changed files with 15 additions and 12 deletions

View File

@ -22,10 +22,7 @@ GTK_THEME="Gruvbox"
THEME="dark"
# Perl junk to allow scripts to run for non-interactive sessions
PERL5LIB="${HOME}/perl5/lib/perl5${PERL5LIB:+:${PERL5LIB}}"; export PERL5LIB;
PERL_LOCAL_LIB_ROOT="${HOME}/perl5${PERL_LOCAL_LIB_ROOT:+:${PERL_LOCAL_LIB_ROOT}}"; export PERL_LOCAL_LIB_ROOT;
PERL_MB_OPT="--install_base \"${HOME}/perl5\""; export PERL_MB_OPT;
PERL_MM_OPT="INSTALL_BASE=${HOME}/perl5"; export PERL_MM_OPT;
eval "$(plenv init -)"
if [ -f "/run/.containerenv" ]; then
source "$HOME/.dotfiles/bash/bash_profile.distrobox"

View File

@ -84,14 +84,6 @@ if [ -f ${HOME}/.dotfiles/bash/bash_aliases ]; then
. "${HOME}/.dotfiles/bash/bash_aliases"
fi
# Perl configs
PERL5LIB="${HOME}/perl5/lib/perl5/x86_64-linux-gnu-thread-multi:${HOME}/.local/usr/local/lib/perl5/5.38.0:${HOME}/perl5/lib/perl5:${HOME}/perl5/lib/perl5/x86_64-linux-thread-multi:${PERL5LIB}"; export PERL5LIB;
PERL_LOCAL_LIB_ROOT="/var/home/jpm/.local/usr/local/lib/perl5/5.38.0:${HOME}/perl5/lib/perl5:${HOME}/perl5/lib/perl5/x86_64-linux-thread-multi:${PERL_LOCAL_LIB_ROOT}"; export PERL_LOCAL_LIB_ROOT;
#PERL_LIB="/var/home/jpm/.local/usr/local/lib/perl5/5.38.0"; export PERL_LIB;
PERL_LIB="/usr/local/lib/perl"; export PERL_LIB;
PERL_MB_OPT="--install_base \"${HOME}/perl5\""; export PERL_MB_OPT;
PERL_MM_OPT="INSTALL_BASE=${HOME}/perl5"; export PERL_MM_OPT;
# Android configs
JDK_HOME=/etc/java
STUDIO_JDK=/usr/lib/jvm/jre-openjdk
@ -109,6 +101,9 @@ export TERM="xterm"
# Set initial title
echo -e -n "\033]2;Welcome to Bash\007"
# Perl
eval "$(plenv init -)"
source ${HOME}/.dotfiles/bash/plenv-path.sh
if [ -f "/run/.containerenv" ]; then
source "$HOME/.dotfiles/bash/bashrc.distrobox"

View File

@ -23,6 +23,11 @@ if [ -e "$HOME/.nix-profile/etc/profile.d/nix.sh" ]; then
source $HOME/.nix-profile/etc/profile.d/nix.sh
fi
# Perl plenv
if [ -d "$HOME/.plenv/bin" ]; then
export PATH="$HOME/.plenv/bin:$PATH"
fi
# Private scripts
if [ -d "$HOME/.private-scripts" ]; then
PATH="$HOME/.private-scripts:$PATH"

5
bash/plenv-path.sh Normal file
View File

@ -0,0 +1,5 @@
#!/bin/bash
PLENV_VERSION=$(plenv version | cut -d ' ' -f 1)
PERL5LIB="$(pwd)/local/lib/perl5/x86_64-linux/:$(pwd)/local/lib/perl5:${HOME}/.plenv/versions/$PLENV_VERSION/lib/perl5/site_perl/${PLENV_VERSION}/x86_64-linux:${HOME}/.plenv/versions/$PLENV_VERSION/lib/perl5/site_perl/${PLENV_VERSION}:${HOME}/perl5/lib/perl5/x86_64-linux-gnu-thread-multi:${HOME}/.local/usr/local/lib/perl5/5.38.0:${HOME}/perl5/lib/perl5:${HOME}/perl5/lib/perl5/x86_64-linux-thread-multi"; export PERL5LIB;

View File

@ -11,6 +11,7 @@ fi
# If directory was just changed to the root of a git repository, print onefetch
if [ -n "$DIRCHANGED" ]; then
source ${HOME}/.dotfiles/bash/plenv-path.sh
if [ -d "$PWD/.git" ]; then
if [[ "$(which onefetch)" == "" ]]; then
echo "This is a git directory, but you don't have 'onefetch' in your PATH"