Skip to content

Instantly share code, notes, and snippets.

@dnlmzw
Created January 4, 2014 21:22
Show Gist options
  • Save dnlmzw/8260901 to your computer and use it in GitHub Desktop.
Save dnlmzw/8260901 to your computer and use it in GitHub Desktop.
Create symbolic link for MAMP "htdocs"-folder to current Terminal window path. Finally open localhost:8888. Shortcut through "setdocs" with alias.
alias setdocs="~/Dropbox/Scripts/set_htdocs_open_localhost.sh"
CUR_PATH=${PWD}
MAMP_PATH="/Applications/MAMP/"
MAMP_PATH_HTDOCS="/Applications/MAMP/htdocs"
echo
echo "Removing Symlink:"
echo ${MAMP_PATH_HTDOCS}
sudo rm ${MAMP_PATH_HTDOCS}
echo
echo "Creating symlink for:"
echo ${CUR_PATH}
ln -s ${CUR_PATH} ${MAMP_PATH_HTDOCS}
echo
echo "Opening localhost"
open "http://localhost:8888"
echo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment