Oliver Davies
d1da7c6e15
Re-organise to use a bare repo, e.g. https://www.atlassian.com/git/tutorials/dotfiles.
43 lines
843 B
Bash
43 lines
843 B
Bash
function m() {
|
|
if [[ -f .notes/Makefile ]];
|
|
then
|
|
make -f .notes/Makefile "$@"
|
|
else
|
|
make "$@"
|
|
fi
|
|
}
|
|
|
|
function mkd() {
|
|
mkdir -p "$@" && cd "$@"
|
|
}
|
|
|
|
function db {
|
|
if [ "$1" = "refresh" ]; then
|
|
mysql -uroot -e "drop database $2; create database $2"
|
|
elif [ "$1" = "create" ]; then
|
|
mysql -uroot -e "create database $2"
|
|
elif [ "$1" = "drop" ]; then
|
|
mysql -uroot -e "drop database $2"
|
|
fi
|
|
}
|
|
|
|
is_linux() { [[ "$(uname)" == 'Linux' ]] }
|
|
is_macos() { [[ "$(uname)" == "Darwin" ]] }
|
|
|
|
function composer() {
|
|
docker run -u $UID -it --rm \
|
|
-v $(pwd):/app \
|
|
-v ~/.composer:/root/.composer \
|
|
-v ~/.ssh:/root/.ssh \
|
|
composer \
|
|
composer $*
|
|
}
|
|
|
|
# Run 'phpunit' or 'pest' depending on the project.
|
|
function p () {
|
|
vendor/bin/$(phpunit-or-pest) $*;
|
|
}
|
|
function pf () {
|
|
vendor/bin/$(phpunit-or-pest) --filter $*
|
|
}
|