Skeletor is a universal project skeletor generator.
{{ mustache }} templating.skeletor.json file.Skeletor is for those people that create new projects on a regular basis and often find themselves wasting time copying / writing boilerplate code.
Install the phar and the public key (required for self updates)
curl -o skeletor.phar https://dantleech.github.io/skeletor/skeletor.phar curl -o skeletor.phar.pubkey https://dantleech.github.io/skeletor/skeletor.phar.pubkey
Now make the PHAR executable and maybe you want to move it somewhere in your path:
chmod a+x skeletor.phar sudo mv skeletor.phar /usr/local/bin/skeletor sudo mv skeletor.phar.pubkey /usr/local/bin/skeletor.pubkey
First you need to install a project template:
skeletor install dantleech/phplib.skel
Then you can generate a project interactively:
skeletor generate
The easiest way to start is probably just to fork an existing repository
Your repository should have a skeletor.json file in its project root:
{
"title": "title for this skeleton",
"description": "description for this skeleton",
"params": {
"param1": "default value 1",
"param2": "default value 2",
"file-name": "foobar"
},
"basedir": "skeletor",
"files": {
"lib": {
"type": "dir"
},
"tests": {
"type": "dir"
},
"lib/my-dynamic-file.txt": {
"type": "file",
"path": "lib/myfile.txt",
"dest": "lib/{{ file-name }}.txt"
}
"LICENSE": {}
"lib/myfile.txt": {}
},
"post_install": [
"copmoser require phpunit/phpunit"
]
}
Your directory structure should look like this:
/
skeletor/
lib/
myfile.txt
foobar.txt
LICENSE
skeletor.json
Note that in the configuration:
lib and tests as directories - these will be explicitly created even if they are not in our repository.basedir and the value is an object of options.type the type is assumed to be templatetemplate type.Each file can have a type:
dir: A directory will be created, it does not have to exist in your repository.file: The file located at the path will be copied verbatim.template: The file will be processed and any {{ tokens }} will be replaced with the parameters corresponding to their values.Both file and template types can have a dest key which can be tokenized.
Files defined with a template type should look something like this:
Hello {{ author.name }}
This is an example template, that was created in {{ date.year }}.
The following parameters are automatically available:
{{ date.year }}: The year.{{ date.month }}: The month.{{ date.day }}: The day.skeletor wisdom skeletor wisdom -r