A command line interface for working with MAMP. It can start and stop your MAMP, but also easily switch the document root so that you can switch projects easily by using a favorite list.
Please backup your httpd.conf file of your MAMP before using this script. It can be found here:
/Applications/MAMP/conf/apache/httpd.conf
$ npm install -g mamp-cli
Depending on your setup you might need sudo in front of this command.
Use this to print the help:
$ mamp
$ mamp start
// start the server
$ mamp stop
// stop the server
$ mamp restart
// restart the Apache, run with sudo
$ mamp list
// list your favorite shortcuts
$ mamp add <shortcut>
// add the current directory to your favorites
$ mamp remove <shortcut>
// remove a shortcut
$ mamp switch <shortcut|path>
// switch the document root to the one of your shortcuts or directly pass a path
$ mamp cwd
// set the current working directory as document root
mamp restart
that runs apachectl -k graceful
in background (run with sudo)mamp add
command to log error if <shortcut>
argument is missing. (@jrmykolyn)mamp switch
mamp cwd
to set the current working directory as document rootSee file LICENSE