Adding Templates to bb-cli
Create and use .bbscaff directory to store templates
-
Create .bbscaff directory in home folder:
mkdir ~/.bbscaff
cd ~/.bbscaff
-
Create a new widget template directory:
mkdir bb-widget-test
-
Create template folder to be used, and bbscaff.js:
mkdir template
touch bbscaff.js
-
Check that your template is available when running bb generate, bb-test-template should be shown in the table:
bb generate
-
Add base code for bbscaff.js:
-
Open bbscaff.js in your editor of choice
-
Add the below to the file and save it:
module.exports = function(bbscaff){};
-
-
Now specifying the template on the cli should work without errors:
bb generate bb-test-template
-
Refer to generate.md for creating template and configuring bbscaff.js
This allows creation of a templates folder in a development directory. It uses symbolic links to create .bbscaff folder
-
Create a templates folder in your desired directory: ($DEV)
cd $DEV
mkdir templates
-
Link templates to the $HOME directory, name the link .bbscaff:
ln -s $DEV/templates ~/.bbscaff
-
When creating new templates, create a new directory with the name of the template:
cd $DEV/templates && mkdir bb-test-template
cd bb-test-template
Similar to above method, however seperates the .bbscaff directory from the templates
-
Create .bbscaff directory in $HOME
mkdir ~/.bbscaff
-
Create a templates folder in the desired directory: (I'll use projects)
mkdir $DEV/templates
-
Create a new template folder with the desired template name:
cd $DEV/templates
mkdir bb-test-widget
-
Link the new templates directory to .bbscaff
ln -s $DEV/templates/bb-test-widget ~/.bbscaff/bb-test-widget