d9e5d343f6c54e2b69fc5560817d62c0d5f9b40d
[yaffs-website] / vendor / chi-teck / drupal-code-generator / README.md
1 # Drupal Code Generator
2
3 [![Build Status](https://travis-ci.org/Chi-teck/drupal-code-generator.svg?branch=master)](https://travis-ci.org/Chi-teck/drupal-code-generator)
4
5 A command line code generator for Drupal.
6
7 ## Installation
8
9 1. Download the latest [stable release](https://github.com/Chi-teck/drupal-code-generator/releases/latest) of the code generator.
10 2. Make the file executable.
11 3. Move it to a directory that is part of your `PATH`.
12
13 ```shell
14 release_url=https://api.github.com/repos/chi-teck/drupal-code-generator/releases/latest
15 wget $(wget -qO- $release_url | awk -F'"' '/browser_download_url/ { print $4 }')
16 chmod +x dcg.phar
17 sudo mv dcg.phar /usr/local/bin/dcg
18 dcg --version
19 ```
20 Installation using Composer is also supported.
21
22 ## Upgrade
23 Simply repeat installation commands.
24
25 ## Usage
26 ```shell
27 # Display main menu.
28 dcg
29
30 # Display Drupal 8 submenu.
31 dcg d8
32
33 # Call generator directly.
34 dcg d8:plugin:field:widget
35
36 # Generate code non interactively.
37 dcg twig-extension -a '{"name": "Example", "machine_name": "example", "class": "ExampleTwigExtension"}'
38 ```
39 ## Extending
40 All custom generators should be placed to _$HOME/.dcg/Command_ directory. The following command will help you to get started with creating own generators.
41 ```bash
42 # Create custom DCG command.
43 dcg dcg-command -d $HOME/.dcg/Command
44 ```
45 ## License
46 GNU General Public License, version 2 or later.