Skip to content

Instantly share code, notes, and snippets.

@udovicic
Last active May 27, 2019 12:26
Show Gist options
  • Save udovicic/9317d98fc6139392220c9ac861c49ace to your computer and use it in GitHub Desktop.
Save udovicic/9317d98fc6139392220c9ac861c49ace to your computer and use it in GitHub Desktop.
#!/bin/bash
function get_project_handle ()
{
local project_handle=${PWD##*/};
echo ${project_handle}
}
if ! grep -q "www.$(get_project_handle).loc" /etc/hosts; then
echo "127.0.0.1 www.$(get_project_handle).loc" | sudo tee -a /etc/hosts > /dev/null
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment