this is a description
Project description
Simple yet powerful code generator. Make use of existing tool as possiable as we can.
Compare to hygen, yo.
- yo is way too slow and complicated.
- hygen pollutes all template files, and only support ejs.
What I only need:
- template is runable as normal prj. No more $placehold$ stuff.
- instinct command with the power of fzf.
- quick project to template and vice versa.
- respect .gitignore.
- support github.com repo.
- plugin in any language only if you can run it in shell.
- respect Old keyword case.
install
pip3 install coge
usage
export COGE_TMPLS="<your_template_folder>"
1
coge js react oldkey:newkey :newkey0 :newkey1 @:destname
What coge does:
- copy $COGE_TMPLS/js/react to $PWD/destname
- change all names from oldkey to newkey, from COGE_ARG_0 to newkey0 ,from COGE_ARG_1 to newkey1
2
coge js react
What coge does:
- Just copy $COGE_TMPLS/js/react to $PWD/app
work with fzf
cg () {
eval `coge -c $@ | fzf --preview= --bind 'enter:execute-silent(pbcopy <<< {})+abort' ` && pbpaste
}
call cg from terminal. and paste it.
timing script
you can put .coge.after.copy.sh in you template folder.
It will execute after copy, which is very handy.
For Safety reason. Template from network would need to use -s option to enforcing script executing, only if you know the script is safe.
Supported timing and language:
.coge.after.sh
.coge.before.sh
.coge.after.py
.coge.before.py
Ex: .coge.after.copy.sh
#!/bin/bash
git init
git flow init
help
usage: coge [-h] [-a ARG_PREFIX] [-l] [-c] [-r] [-R] [-w] [-s] [-d DEPTH] [-v]
[magic ...]
make template link : cd x-engine-module-template && coge -r
use template : coge x-engine-module-template xxxx:camera @:x-engine-module-camera
use git template from net : coge https://www.github.com/vitejs/vite \bvite\b:your_vite @:your_vite
positional arguments:
magic newkey:oldkey or @:folder_name
optional arguments:
-h, --help show this help message and exit
-a ARG_PREFIX, --arg_prefix ARG_PREFIX
ex: COGE_ARG_
-l, --list list folders
-c, --cmd cmd
-r, --link_tplt link `cwd` to $COGE_TMPLS
-R, --unlink_tplt unlink `cwd`
-w, --allow_git_dirty alllow git dirty, still, file not commited will not copy!
-s, --script_from_net
alllow script from net
-d DEPTH, --depth DEPTH
list depth
-v, --version version
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
coge-0.1.3-py2.py3-none-any.whl
(11.1 kB
view details)
File details
Details for the file coge-0.1.3-py2.py3-none-any.whl
.
File metadata
- Download URL: coge-0.1.3-py2.py3-none-any.whl
- Upload date:
- Size: 11.1 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d15ade0790e2609649b4d1f975e0ee3db0bc58e805a09a485dc7024f61bc0e00 |
|
MD5 | e7be7f50a011ebdff0d2d3f30f9007ca |
|
BLAKE2b-256 | 064f87ba2ee7510ce6d9d1aaa47e5b29cc16eebf1626142364dce2deaa609579 |