initial-cli
A project initializer.
How to use
from GitHub
initial [github/]<owner>/<slug>[#branch] <project name>
from GitLab
initial gitlab/<owner>/<slug>[#branch] <project name>
from other git repo
initial <git repo url>[#branch] <project name>// or pre-set short nameinitial <short name>/<owner>/<slug>[#branch] <project name>
alias git repo
Edit the configure file before use this.
initial <alias name> <project name>
Configure file
$HOME
/.init/config.json
How create template
Assets file
The asset files will remove after initialized. You can put the option files in it.
The directory name is
.init-assets
.
Initialize file
File name:
.init.js
Inquire uses module who names
Inquirer.js
.
// you can require: fs, path, glob, rimraf, and other core modulesexportsquestions = {} // your questions, see: Inquirer.js;exports { // the JS codes // you can copy the file from assets // module.rm => rimraf.sync // module.copy => fs.copySync}
Template files
All
*.*
file except.init.js
or under.init-assets
All question answer and project_name will pass into the template processor.
Usage
// direct output variable using syntax as %var_name%title = "%project_name%"// boolean condition#if boolVal##endif##if boolVar eq true##endif#// string condition#if strVar eq 'value'##endif##if strVar ne 'value'##endif#// list condition#if listVar has 'value'##endif#