Skip to content

alajmo/template-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Template Generator

Conventional Commits

A simple bash script used to manage boilerplates.

example usage of template-generator

Prerequisite

  • Bash 4.2 >

Install

  1. Put the file tp in an executable path.
  2. Create a directory named boilerplates in your home folder and fill it with boilerplates.

Furthermore, if you want bash-autocompletion:

  1. Install boilerplates-completion.
  2. Source tp-completion.sh from ~/.bash_completion.

Usage

template-generator - Template generator CLI

Usage: tp [command] [arguments]

Options:
  -h, --help                       Print this help
  -v, --version                    Print script version
  -L, --level                      Max display depth of the directory tree
  -b, --boilerplate-path <path>    Specify boilerplate path
  -f, --format <tree|line>         List format [default: tree]

Commands:
  list|ls|l [subdirectory]         List boilerplates.
  generate|g [boilerplate] [dest]  Generate boilerplate.
  preview|p [boilerplate]          Preview boilerplate.
  edit|e [boilerplate]             Edit boilerplate in editor.
  remove|rm|r [boilerplate]        Remove a boilerplate.
  new|n [file] [dest]              Add a new boilerplate.

Examples:
  # Show first depth level of boilerplates path.
  $ tp ls -L 1

  # Copy boilerplate file.txt to current directory with filename new-file.txt
  $ tp generate files/file.txt new-file.txt

Boilerplate Path:

  The order of precedence (highest to lowest) is:
    1. Path specified in options
    2. Environment variable BOILERPLATES_PATH
    3. $PWD/.boilerplates/
    4. $PWD/boilerplates/
    5. ~/.boilerplates/
    6. ~/boilerplates/

About

🔧 Generate boilerplates from CLI

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages