Skip to content

Commit

Permalink
Remove the set_use_prefix() command in the stdlib
Browse files Browse the repository at this point in the history
There's no really good story for that. Homebrew is not really ment to have
multiple version of the same project (`brew cleanup` will remove older-ones)
and I don't know about other platforms.

It's better to create your own use_ extensions in the ~/.direnvrc for now.
  • Loading branch information
Jonas Pfenniger committed Jun 16, 2013
1 parent 6903438 commit e942c75
Showing 1 changed file with 7 additions and 23 deletions.
30 changes: 7 additions & 23 deletions cmd_stdlib.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@ load_prefix() {
path_add PKG_CONFIG_PATH "$path/lib/pkgconfig"
}
# Pre-programmed project layout. Add your own in your ~/.direnvrc.
#
# Usage: layout TYPE
layout() {
eval "layout_$1"
Expand Down Expand Up @@ -178,32 +179,15 @@ layout_node() {
PATH_add node_modules/.bin
}
# This folder contains a <program-name>/<version> structure
use_prefix=/usr/local/Cellar
set_use_prefix() {
use_prefix="$1"
}
# Intended to load external dependencies into the environment.
#
# Usage: use PROGRAM_NAME VERSION
# Example: use ruby 1.9.3
use() {
local cmd="$1"
if has use_$cmd ; then
echo "Using $@"
shift
use_$cmd "$@"
return $?
fi
local path="$use_prefix/$1/$2"
if [ -d "$path" ]; then
echo "Using $1 v$2"
load_prefix "$path"
return
fi
echo "* Unable to load $path"
return 1
echo "Using $@"
shift
use_$cmd "$@"
}
# Usage: use rbenv
Expand Down

0 comments on commit e942c75

Please sign in to comment.