Chris@0: # Drupal Code Generator Chris@0: Chris@0: [![Build Status](https://travis-ci.org/Chi-teck/drupal-code-generator.svg?branch=master)](https://travis-ci.org/Chi-teck/drupal-code-generator) Chris@0: Chris@0: A command line code generator for Drupal. Chris@0: Chris@0: ## Installation Chris@0: Chris@0: 1. Download the latest [stable release](https://github.com/Chi-teck/drupal-code-generator/releases/latest) of the code generator. Chris@0: 2. Make the file executable. Chris@0: 3. Move it to a directory that is part of your `PATH`. Chris@0: Chris@0: ```shell Chris@0: release_url=https://api.github.com/repos/chi-teck/drupal-code-generator/releases/latest Chris@0: wget $(wget -qO- $release_url | awk -F'"' '/browser_download_url/ { print $4 }') Chris@0: chmod +x dcg.phar Chris@0: sudo mv dcg.phar /usr/local/bin/dcg Chris@0: dcg --version Chris@0: ``` Chris@0: Installation using Composer is also supported. Chris@0: Chris@0: ## Upgrade Chris@0: Simply repeat installation commands. Chris@0: Chris@0: ## Usage Chris@0: ```shell Chris@0: # Display main menu. Chris@0: dcg Chris@0: Chris@0: # Display Drupal 8 submenu. Chris@0: dcg d8 Chris@0: Chris@0: # Call generator directly. Chris@0: dcg d8:plugin:field:widget Chris@0: Chris@0: # Generate code non interactively. Chris@0: dcg twig-extension -a '{"name": "Example", "machine_name": "example", "class": "ExampleTwigExtension"}' Chris@0: ``` Chris@0: ## Extending Chris@0: All custom generators should be placed to _$HOME/.dcg/Command_ directory. The following command will help you to get started with creating own generators. Chris@0: ```bash Chris@0: # Create custom DCG command. Chris@0: dcg dcg-command -d $HOME/.dcg/Command Chris@0: ``` Chris@0: ## License Chris@0: GNU General Public License, version 2 or later.