-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy path.envrc
More file actions
30 lines (26 loc) · 739 Bytes
/
.envrc
File metadata and controls
30 lines (26 loc) · 739 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Add "complete -C project project" to your .bashrc
# prepending
export GOBIN=$PWD/bin/tools
export PATH=$GOBIN:$PATH
export PATH=$GOBIN/bin:$PATH
export PATH=$PWD/bin/tools/bin:$PATH
export PATH=$PWD/bin:$PATH
export PATH=$PWD/bin/build:$PATH
alias_dir=$PWD/.direnv/aliases
export_alias() {
local name=$1
shift
local target="$alias_dir/$name"
local oldpath="$PATH"
mkdir -p "$alias_dir"
if ! [[ ":$PATH:" == *":$alias_dir:"* ]]; then
PATH_add "$alias_dir"
fi
echo "#!/usr/bin/env bash" >"$target"
echo "PATH=\"$oldpath\"" >>"$target"
echo "$@" >>"$target"
chmod +x "$target"
}
if typeset -f source_env >/dev/null; then # ignore when sourcing .envrc
{ [[ -f .envrc.local ]] && source_env .envrc.local; }
fi