Move old scripts into a subdir
This commit is contained in:
parent
b9a82c6e33
commit
6b49d958d8
7 changed files with 0 additions and 0 deletions
33
misc/switch-profile
Executable file
33
misc/switch-profile
Executable file
|
@ -0,0 +1,33 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# This is based on an idea stolen from Oliver; see his great blog post
|
||||
# http://blogs.perl.org/users/oliver_gorwits/2011/07/locallibs-for-dist-development.html
|
||||
# for the rationale.
|
||||
#
|
||||
# This script works hand-in-hand with new-profile.
|
||||
#
|
||||
|
||||
if [ -z "$1" ]
|
||||
then
|
||||
echo 'Pass the profile name, please'
|
||||
echo 'Valid profiles:'
|
||||
for DIRENT in ${HOME}/perl-profiles/*; do
|
||||
if test -d "${DIRENT}"; then
|
||||
PROFILE=${DIRENT##*/}
|
||||
echo " ${PROFILE}"
|
||||
fi
|
||||
done
|
||||
exit
|
||||
fi
|
||||
|
||||
PROFILE="$1"
|
||||
|
||||
if ! test -d "${HOME}/perl-profiles/${PROFILE}"; then
|
||||
echo "No such profile ${PROFILE}" >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
export PROFILE
|
||||
exec env PATH=${HOME}/bin:/bin:/usr/bin PERL5LIB= \
|
||||
"${HOME}/perl-profiles/${PROFILE}/bin/localenv" \
|
||||
/bin/bash --rcfile "${HOME}/perl-profiles/${PROFILE}/etc/bashrc"
|
Loading…
Add table
Add a link
Reference in a new issue