mirror of
https://github.com/chenasraf/dotfiles.git
synced 2026-05-18 01:29:06 +00:00
36 lines
568 B
Bash
Executable File
36 lines
568 B
Bash
Executable File
#!/usr/bin/env zsh
|
|
|
|
SCAFFOLDS_DIR="$DOTFILES/scaffolds"
|
|
|
|
|
|
tpl () {
|
|
declare -A tpl_aliases=(
|
|
ef "editorfiles"
|
|
gh "github"
|
|
ghp "github.pnpm"
|
|
)
|
|
declare -A tpl_no_name=(
|
|
editorfiles "1"
|
|
gh "1"
|
|
ghp "1"
|
|
)
|
|
key=$1
|
|
shift
|
|
args="$@"
|
|
if [[ ! -z "${tpl_aliases[$key]}" ]]; then
|
|
key=${tpl_aliases[$key]}
|
|
fi
|
|
|
|
if [[ "${tpl_no_name[$key]}" -eq 1 ]]; then
|
|
name="- $args"
|
|
else
|
|
if [[ -z "$args" ]]; then
|
|
echo_red "Usage: tpl $key <name>"
|
|
return 1
|
|
fi
|
|
fi
|
|
|
|
simple-scaffold -g chenasraf/templates -k $key $args
|
|
}
|
|
|