init parameterize init_db and add pzsh
This commit is contained in:
parent
5e7f99c2ed
commit
8ed11a05f1
@ -255,4 +255,4 @@ alias vim_plain="vim -u NONE"
|
||||
alias edit_alias="vim $yadr_zsh/aliases.zsh $yadr_zsh/functions.zsh -p"
|
||||
alias rubocop='rubocop --require rubocop-performance --format progress'
|
||||
alias docker_purge='docker stop $(docker ps -qa);docker rm $(docker ps -qa)'
|
||||
alias init_server_db='ds rails db:create db:migrate db:seed'
|
||||
alias pzsh='proxychains zsh'
|
||||
|
@ -132,7 +132,19 @@ function swap() {
|
||||
}
|
||||
|
||||
function init_db() {
|
||||
dc exec $1 rails db:drop db:create db:migrate db:seed
|
||||
SERVICE=server
|
||||
while getopts ":s:" o; do
|
||||
case "${o}" in
|
||||
s)
|
||||
SERVICE=${OPTARG}
|
||||
;;
|
||||
*)
|
||||
echo "Usage: init_db [-s SERVICE]"
|
||||
return
|
||||
;;
|
||||
esac
|
||||
done
|
||||
dc exec $SERVICE rails db:drop db:create db:migrate db:seed
|
||||
}
|
||||
function cmd_exists() {
|
||||
$* &> /dev/null
|
||||
|
Loading…
Reference in New Issue
Block a user