gapp
Version:
Automate Development
212 lines (151 loc) • 3.97 kB
Markdown
> gapp - in progress
<h1>gapp - Automate Development</h1>
```bash
npm install -g gapp
```
## Table of Contents
- <a href="#Yeoman">Yeoman Generators</a><br>
- <a href="#Conditionals">Command Line Conditionals</a><br>
- <a href="#Server">Create a Request Server</a><br>
- <a href="#npmInstall">Npm Install</a><br>
- <a href="#npmUnInstall">Npm Uninstall</a><br>
- <a href="#Shell">Shell</a><br>
<h2 id="Yeoman">Yeoman Generators</h2>
With gapp, yeoman has been simplified. There is no need to run the introductory methods.
<br>
For example, with the yeoman angular generator, if you don't have it, you would have to run
```bash
npm install -g generator-angular
```
Then
```bash
yo angular
```
In gapp you run
```bash
gapp --gen angular
```
If you don't have the generator, it will install it then run the generator automatically.
<br>
To run sub-generators you still have to use yo.<br>
eg.
```bash
yo angular:controller
```
But <strong>yo</strong> comes as a <strong>global</strong> package with <strong>gapp</strong>
<h2 id="Conditionals">Command Line Conditionals</h2>
gapp can run any command through if, elseif, and else conditionals.<br>
- Any JavaScript comparison operator is applicable. Truthy and Falsy ones included.
- Quotes aren't necessary, but suggested for readability.
Example:
```bash
gapp if $TOMCAT_HOME === '/Library/Tomcat' then 'echo Found Tomcat' elseif $NODE_ENV === 'production' then 'echo in production mode' else 'echo nothing was true!'
```
gapp can perform
- if
- if -> else
- if -> elseif -> else
At the moment
Suggested by <a href="https://github.com/toish">toish</a>!
<h2 id="Server">Create a Request Server</h2>
Options:
- serve (--serve) [required]
Route from which to serve
- type (--type) [Default: get]
Type of route<br>
available types [get, post, delete, put]
- file (--file) or message (-m) [required]
File/Message returned from route
- port (-p) [Default: 3000]
- static (--static)
Static folder served
Examples:
```bash
gapp --serve /route --type get --file app/index.html --static app/public -p 8080
```
```bash
gapp --serve /route --type get -m 'This is the /get route!' --static app/public -p 8080
```
<h2 id="npmInstall">Install any npm package. (global, save, save-dev)</h2>
## LOCAL
Install to project dependencies
```bash
gapp -i package
```
Same as
```bash
npm install --save package
```
Install to project dev dependencies
```bash
gapp -id package
```
Same as
```bash
npm install --save-dev package
```
## GLOBAL
```bash
gapp -ig package
```
Same as
```bash
npm install -g package
```
## GLOBAL AND LOCAL DEPENDENCIES
```bash
gapp -igs package
```
Same as
```bash
npm install -g --save package
```
<hr>
```bash
gapp -igd package
```
Same as
```bash
npm install -g --save-dev package
```
<h2 id="npmUnInstall">Uninstall any npm package. (global, local)</h2>
```bash
gapp -u package
```
Same as
```bash
npm uninstall -g package
```
<hr>
```bash
gapp -ul package
```
Same as
```bash
npm uninstall package
```
<h2 id="Shell">Shell</h2>
With gapp you can combine all of the previous commands and also run shell commands chained through gapp.
```bash
gapp -r echo im running some command!
```
A shell command can only be strung together if it last in the chain or the only command being ran. Otherwise use quotes/singles quotes.
PROPER
```bash
gapp -ig package -u anotherpackage --gen angular -r echo im saying something!
```
PROPER
```bash
gapp -ig package -u anotherpackage -r 'echo im saying something!' --gen angular
```
IMPROPER
```bash
gapp -ig package -u anotherpackage -r echo im saying something! --gen angular
```
```gapp``` is picky when it comes to subsequent variables.!
## License
MIT © [Google](https://github.com/iansawyerva)
[npm-image]: https://badge.fury.io/js/gapp.svg
[npm-url]: https://npmjs.org/package/gapp
[daviddm-image]: https://david-dm.org/iansawyerva/gapp.svg?theme=shields.io
[daviddm-url]: https://david-dm.org/iansawyerva/gapp