-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.envrc
More file actions
33 lines (27 loc) · 926 Bytes
/
.envrc
File metadata and controls
33 lines (27 loc) · 926 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
31
32
33
COMPLETION_DIR="$PWD/.direnv/bash-completion/completions"
mkdir -p "$COMPLETION_DIR"
if [ -x "./todo-cli" ]; then
./todo-cli completion bash > "$COMPLETION_DIR/todo-cli"
fi
# bash completion automatically looks inside $XDG_DATA_DIRS/bash-completion/completions/
export XDG_DATA_DIRS="$PWD/.direnv:${XDG_DATA_DIRS:-/usr/local/share:/usr/share}"
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
rm -rf "$alias_dir"
export_alias ci_status "gh run list --branch main --limit 3"