Skip to content

Instantly share code, notes, and snippets.

@erdemkeren
Last active October 24, 2019 17:16
Show Gist options
  • Save erdemkeren/c4d58847b59f455ef3a04d05d967bad3 to your computer and use it in GitHub Desktop.
Save erdemkeren/c4d58847b59f455ef3a04d05d967bad3 to your computer and use it in GitHub Desktop.
Vagrant/Homestead - Git - Dotenv - Laravel aliases file.
# Edit this using atom.
alias edit-aliases="atom ~/.aliases.bash"
# Laravel & CodeCeption, PhpSpec.
alias art="php artisan"
alias spec="./vendor/bin/phpspec"
alias cept="./vendor/bin/codecept"
# PHPCS
alias phpcs="./vendor/bin/phpcs"
alias phpcbf="./vendor/bin/phpcbf"
# Git aliases.
alias gs="git status"
alias gd="git diff"
alias ga="git add"
alias gaa="git add ."
alias gup="git pull"
alias gc="git commit -m "
# VM
# Start virtual machine.
function svm {
if [ -f Vagrantfile ];
then
vagrant up;
elif [ -f ./vendor/bin/homestead ];
then
./vendor/bin/homestead up;
else
echo -e "\e[33mWarning: \e[39mNeither Vagrantfile nor executable Homestead could be found.";
fi
}
# Halt virtual machine.
function hvm {
if [ -f Vagrantfile ];
then
vagrant halt;
elif [ -f ./vendor/bin/homestead ];
then
./vendor/bin/homestead halt;
else
echo -e "\e[33mWarning: \e[39mNeither Vagrantfile nor executable Homestead could be found.";
fi
}
# Provision virtual machine.
function provm {
if [ -f Vagrantfile ];
then
vagrant provision;
elif [ -f ./vendor/bin/homestead ];
then
./vendor/bin/homestead provision;
else
echo -e "\e[33mWarning: \e[39mNeither Vagrantfile nor executable Homestead could be found.";
fi
}
# Destroy virtual machine.
function dvm {
if [ -f Vagrantfile ];
then
vagrant destroy;
elif [ -f ./vendor/bin/homestead ];
then
./vendor/bin/homestead destroy;
else
echo -e "\e[33mWarning: \e[39mNeither Vagrantfile nor executable Homestead could be found.";
fi
}
# Ssh virtual machine.
function vm {
if [ -f Vagrantfile ];
then
vagrant ssh;
elif [ -f ./vendor/bin/homestead ];
then
./vendor/bin/homestead ssh;
else
echo -e "\e[33mWarning: \e[39mNeither Vagrantfile nor executable Homestead could be found.";
fi
}
# Other
alias c="clear"
alias cds="cd ~/dev/Sun"
alias cde="cd ~/dev/Env"
alias cdc="cd ~/dev/Code"
alias cdce="cd ~/dev/Code/educode"
alias cdcw="cd ~/dev/Code/workcode"
alias cdcp="cd ~/dev/Code/procode"
function devenv {
if [ -f .env.dev ];
then
mv .env .env.testing;
mv .env.dev .env;
else
echo -e "\e[32mInfo: \e[39mThe active environment is already the development environment environment."
echo -e "\e[33mOr the active directory is not an dotenv driven project directory.";
fi
}
function testenv {
if [ -f .env.testing ];
then
mv .env .env.dev;
mv .env.testing .env;
else
echo -e "\e[32mInfo: \e[39mThe active environment is already the testing environment."
echo -e "\e[33mOr the active directory is not an dotenv driven project directory.";
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment