-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaliases
104 lines (91 loc) · 1.78 KB
/
aliases
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# Unix
alias c="clear"
alias ls="ls -l"
alias rm="trash"
alias vim="nvim"
# git
alias g="git"
alias gadd="git a"
# Bundler
alias be="bundle exec"
alias br="rake_command"
# Rails
alias rc="console_command"
alias rs="server_command"
alias rake="rake_command"
alias kamal="kamal_command"
alias rspec="rspec_command"
alias migrate="rake_command db:migrate"
alias rubocop="rubocop_command"
# Miscellaneous
alias brewhaha="brew cleanup -s && brew old"
alias icloud="cd ~/Library/Mobile\ Documents"
alias icloud-obsidian="cd ~/Library/Mobile\ Documents/iCloud~md~obsidian/Documents/Personal"
# Helpers
console_command() {
if [ -f app.rb ]; then
bundle exec irb --multiline -r./app.rb
else
rails_command console
fi
}
kamal_command() {
if [ -f bin/kamal ]; then
if [ -f .env ]; then
eval $(cat .env) bin/kamal "$@"
else
bin/kamal "$@"
fi
else
echo "No bin/kamal script found."
fi
}
server_command() {
if [ -f bin/dev ]; then
bin/dev
elif [ -f Procfile.dev ]; then
foreman start -f Procfile.dev
elif [ -f Procfile ]; then
foreman start
else
rails_command server
fi
}
rails_command() {
if [ -f bin/rails ]; then
bin/rails "$@"
else
bundle exec rails "$@"
fi
}
rake_command() {
if [ -f bin/rake ]; then
bin/rake "$@"
else
bundle exec rake "$@"
fi
}
rspec_command() {
if [ -f bin/rspec ]; then
bin/rspec "$@"
else
bundle exec rspec "$@"
fi
}
rubocop_command() {
if [ -f bin/rubocop ]; then
bin/rubocop -P "$@"
elif [ -f Gemfile ]; then
bundle exec rubocop -P "$@"
fi
}
services-start() {
brew services start memcached
brew services start postgresql
brew services start redis
}
services-stop() {
brew services stop memcached
brew services stop postgresql
brew services stop redis
}