-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhelpers
More file actions
executable file
·45 lines (36 loc) · 814 Bytes
/
helpers
File metadata and controls
executable file
·45 lines (36 loc) · 814 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
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
source "$DOTFILES_ROOT/print_helper"
link_files () {
ln -sf "$1" "$2"
success "Linked $1 to $2"
}
current_dir () {
CURRENT_DIR="$(cd "$(dirname "$0")" && pwd)"
echo "$CURRENT_DIR"
}
link_all_files () {
local directory=$1
for source in `find $directory -maxdepth 1 -name \*.symlink`
do
dest="$HOME/.`basename \"${source%.*}\"`"
link_files "$source" "$dest"
done
}
command_exists () {
command -v "$1" &> /dev/null
}
ensure_command_exists () {
if ! command_exists "$1"
then
fail "Command line '$1' not found"
fi
}
bundle_current_dir() {
brew bundle --file="$(current_dir)/Brewfile"
}
current_profile() {
if [ -f "$DOTFILES_ROOT/.current_profile" ]; then
current_profile=$(head -n 1 "$DOTFILES_ROOT/.current_profile")
echo "$current_profile"
fi
}