cgen

command module
v0.6.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 17, 2022 License: MIT Imports: 1 Imported by: 0

README

cgen

cgen

Download and Install

sh -c "$(curl -fsSL https://raw.github.com/techdecaf/cgen/master/install.sh)"
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://raw.github.com/techdecaf/cgen/master/install.ps1'))

Download Links

To install cgen, use the provided script, simlink it or place it in any directory that is part of your path. i.e. /usr/local/bin or c:\windows

Quick Start

You can use cgen to dynamically configure new projects based
   on your own standards and best practices. See the README.md to get started.

Usage:
  cgen [flags]
  cgen [command]

Available Commands:
  bump        Creates a new git tag with an increase in the current semversion i.e. v1.0.2
  completion  Generates zsh completion scripts
  help        Help about any command
  install     Installs a new generator from a git repository
  list        prints a list of currently installed directories
  promote     promote a file from a project to your cgen template
  upgrade     this features is not currently supported pull request?

Flags:
  -h, --help              help for cgen
  -n, --name string       what do you want to call your newly generated project?
  -p, --path string       where you would like to generate your project. (default "/Users/ward/@decaf/cli/cgen")
  -s, --static-only       does not generate template files (most commonly used with update)
  -t, --template string   specify a which template you would like to use.
      --verbose           enable verbose log messages
  -v, --version           prints the cgen version number

Use "cgen [command] --help" for more information about a command.

This project is designed to be a cross platform plugin-based project generator. Simply run cgen to get started!

Installing a Template

cgen 😍 plugins, but it does not use package management, instead you can just reference any git repository that you have access to.

cgen install https://github.com/techdecaf/cgen-template
Creating Your own Template Plugin

You can actually use cgen to create a cgen template 🎉

# install the cgen template generator for templates
cgen install https://github.com/techdecaf/cgen-template

# create a new directory for your template
mkdir my-new-template

# execute cgen, follow the prompts
cgen -t cgen-template

You can take a look at the cgen-template project for more information on use and details for how to create your own templates.

We use the go template engine to create your project, you can find detailed documentation here:


// {{.Name}} project was generated by robots at
// {{ .Timestamp }}
// using data from
// {{ .URL }}
{{- range .MyArray }}
    {{ printf "%q" . }},
{{- end }}

Template Operators Operators
  • eq - Returns the boolean truth of arg1 == arg2
  • ne - Returns the boolean truth of arg1 != arg2
  • lt - Returns the boolean truth of arg1 < arg2
  • le - Returns the boolean truth of arg1 <= arg2
  • gt - Returns the boolean truth of arg1 > arg2
  • ge - Returns the boolean truth of arg1 >= arg2
Updating a template
Full project generation

cgen creates an answer file in the root of your project, if you wish to upgrade your project with a newer version of your installed template just cd <project_dir> and cgn upgrade.

Updating static files only

static files: are any files that do not end in .tmpl

cd <my_project_dir>
cgen -upgrade -staticOnly
Bumping a project version

Wait, what? Why does a generator do this?

we added a bump feature to cgen to help with your projects life cycle, frequently we end up using many different tools to change the version of a project depending on the language we are using. However we felt that git was the correct place to bump and release new versions of our code. So you can also use cgen to handle this for you.

To use run cgen bump --level <major | minor | patch | pre-release string> and cgen will update your git tags with a new semver.

Contribution Guide

Credits

The logo for this project provided by logomakr

Sponsor

TechDecaf

Get back to doing what you do best, let us handle the rest.

Documentation

Overview

Copyright © 2019 [email protected]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL