All Projects → yoshuawuyts → templates

yoshuawuyts / templates

Licence: Apache-2.0 license
Template files used to generate things

Programming Languages

shell
77523 projects
rust
11053 projects
javascript
184084 projects - #8 most used programming language
Dockerfile
14818 projects

templates

Template files used to generate things. Uses the {{varname}} syntax for interpolation. Each project has a manifest.json file the metadata for that template.

Usage

This templates directory is meant to be sourced through a shell script. It's a neat little way of multiplexing arbitrary initialization commands. Here's a basic version you can place in your /usr/bin directory (or equivalent):

#!/bin/sh

if [ ! -z "$TEMPLATES" ]; then
  printf 'bin/ew: TEMPLATES variable not set\n'
  exit 1
fi

if [ $# = "0" ]; then
  printf 'usage: ew <template_name>\n'
  exit 1
fi

template="$TEMPLATES/$1/main"
if [ ! -x "$template" ]; then
  printf 'bin/ew: template %s does not exist\n' "$1"
  exit 1
fi

shift
"$template" "$@"

You can now run commands using ew, for example:

$ ew shell my_cool_shell_script

See Also

License

Apache-2.0

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].