๐๏ธ Generic template generator
Aloha is a command line tool focused on speed-up boring tasks such as creating bureaucratic architecture file structures. It follows templates provided by the user and apply then at the designated path renaming files and content if needed.
- First compile the project
make release
- The executable will appear at
aloha/.build/release/aloha
- You can either add to
$PATH
or set analias
- build a image with aloha
docker build -t aloha:1.0 .
- run the contaier passing the command parameters
docker run --rm -v "$PWD":/home/user/proj aloha:1.0 aloha
- Run
aloha start
on your project directory to create the basic file structure. - Create the templates at
aloha/templates
each directory here is considered a different template.
- Create a example template
mkdir aloha/templates/my_example
- Now inside the
aloha/templates/my_example
create a filecontrol.json
, this defines where each file or directory should be moved to.
- The actual templates are created just like a file structure using directories and files.
- The key word
__name__
indicates where the argumentname
should be replaced on file names and file content. - example call name Aloha for
__name__ExampleDir
becomesAlohaExampleDir
.
targets
the array of items with the targets indicating from which template model should be copied to.model
is where in local template that specific directory of file should be copied from.destination
is where themodel
template should be copied to, renamed with the parametername
and if it's a file the content will also be modified if it have__name__
key word.justCopy
is an array with the name of files or directories that should only be copied, their content wont be modified.
{
"targets": [
{
"model": "__name__ExampleDir",
"destination": "SomeProject"
},
{
"model": "Package.swift",
"destination": "SomeProject"
},
{
"model": "__name__Coordinator.swift",
"destination": "SomeProject"
}
],
"justCopy": [
"project.xcworkspace",
"Assets.xcassets",
"Base.lproj",
"Info.plist",
".gitignore"
]
}