-
Notifications
You must be signed in to change notification settings - Fork 0
Marv Commands
Marv comes with a handful of commands that help make theme and plugin development easy.
$ marv create project-name
Creates the project-name directory if it doesn't exist, and sets up a new Marv project in that directory.
A new Marv project contains directories for your assets, templates, functions and includes. Marv also generates a few standard WordPress templates and adds some example Sass / CSS.
See how Marv works for a detailed explanation of how a Marv project is structured.
$ marv link server-name
Must be run from within a Marv project
It creates a symbolic link for your project in a Marv Server. Depending on the answer to which folder to create the link, the symbolic link will be created in the themes or plugins WordPress directory ~/.marv/servers/server-name/wp-content/themes
.
If you already have WordPress installed in a local directory, you can use the installation path to link your project.
$ marv link /var/www/wordpress
It creates a symbolic link for your project in a local WordPress installation. Depending on the answer to which folder to create the link, the symbolic link will be created in the themes or plugins WordPress directory /var/www/wordpress/wp-content/themes
.
If you have created many Marv servers and you want your project to be available on all of them, you can create a link to the Marv global themes or plugins directory.
$ marv link
It creates a symbolic link for your project in the Marv global directory. Depending on the answer to which folder to create the link, the symbolic link will be created in the themes or plugins directory ~/.marv/themes
.
$ marv watch
Must be run from within a Marv project
Watches the source directory in your project for changes and compiles those changes in the Marv build directory .watch/build
, which should be linked to your Marv server or WordPress installation after running marv link
.
Marv watch is where the magic happens - you need to leave marv watch running while working on your project.
For a more detailed explanation of what happens during marv watch
, check out how Marv works.
$ marv build
Must be run from within a Marv project
Compiles your project from the source directory into the build directory. If you want to build somewhere other than build, you can specify the directory by running
$ marv build build-directory
Marv build is useful if you want to review Marv's output before releasing your project.
$ marv package
Must be run from within a Marv project
Compiles your project and zips it to package/your_project_name.zip
. To name the zip file, run
$ marv package package-name
and the project will be compiled to package/package-name.zip
.
$ marv server create server-name
Creates a new Marv development server in ~/.marv/servers/server-name
. It requires your MySQL username, password, host and port in order to create a new database for the Wordpress installation. Also you can choose which WordPress version to install, defaults to the latest. The very first time you use this command a global configuration file is created for projects and servers, which is stored in ./marv
$ marv server list
Returns a list with all the available Marv servers.
$ marv server list running
Returns a list with all the running Marv servers.
You can use the commands below to control the servers created with Marv.
$ marv server start server-name
Starts your Marv server and provides a link to open in your browser.
$ marv server stop server-name
Stops your running Marv server.
$ marv server stop all
Stops all running Marv servers.
$ marv server restart server-name
Restarts your running Marv server.
$ marv server remove server-name
Removes your Marv server files and database.
$ marv config
Remakes your global configuration file for marv projects and servers