diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2017-11-17 11:34:31 -0200 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2017-11-17 11:34:31 -0200 |
commit | ca223571c8548fda2e6571daf497482d8d236362 (patch) | |
tree | 86daa0f8eba8222b7d5ff85c0b4e101795b7c450 /share | |
parent | f6851134c07c74554437db5be4abb13cafafc1b6 (diff) | |
download | templater-ca223571c8548fda2e6571daf497482d8d236362.tar.gz templater-ca223571c8548fda2e6571daf497482d8d236362.tar.bz2 |
Rename __templater_ functions to templater_
Diffstat (limited to 'share')
27 files changed, 78 insertions, 78 deletions
diff --git a/share/templater/agpl/setup b/share/templater/agpl/setup index 216722b..7d7eabc 100755 --- a/share/templater/agpl/setup +++ b/share/templater/agpl/setup @@ -12,10 +12,10 @@ source $SHARE/templater/functions || exit 1 # AGPLv3 License function templater_agpl { if [ ! -e "LICENSE" ]; then - __templater_echo "Setting up Affero GPLv3 License..." + templater_echo "Setting up Affero GPLv3 License..." cp $SHARE/agpl/files/LICENSE . else - __templater_echo "LICENSE already set" + templater_echo "LICENSE already set" fi } diff --git a/share/templater/apache/setup b/share/templater/apache/setup index ca14efa..0ac127b 100755 --- a/share/templater/apache/setup +++ b/share/templater/apache/setup @@ -12,10 +12,10 @@ source $SHARE/templater/functions || exit 1 # Apache License function templater_apache { if [ ! -e "LICENSE" ]; then - __templater_echo "Setting up Apache License..." + templater_echo "Setting up Apache License..." cp $SHARE/apache/files/LICENSE . else - __templater_echo "LICENSE already set" + templater_echo "LICENSE already set" fi } diff --git a/share/templater/basic/setup b/share/templater/basic/setup index cb7b22f..b90f5b2 100755 --- a/share/templater/basic/setup +++ b/share/templater/basic/setup @@ -25,7 +25,7 @@ function templater_basic { touch ChangeLog else - __templater_echo "Basic files already set" + templater_echo "Basic files already set" fi } diff --git a/share/templater/bsd/setup b/share/templater/bsd/setup index 90042a4..6789b04 100755 --- a/share/templater/bsd/setup +++ b/share/templater/bsd/setup @@ -12,10 +12,10 @@ source $SHARE/templater/functions || exit 1 # BSD License function templater_bsd { if [ ! -e "LICENSE" ]; then - __templater_echo "Setting up BSD 3-clause (New BSD) License..." + templater_echo "Setting up BSD 3-clause (New BSD) License..." cp $SHARE/bsd/files/LICENSE . else - __templater_echo "LICENSE already set" + templater_echo "LICENSE already set" fi } diff --git a/share/templater/conduct/setup b/share/templater/conduct/setup index f2c1873..10b3aac 100755 --- a/share/templater/conduct/setup +++ b/share/templater/conduct/setup @@ -12,10 +12,10 @@ source $SHARE/templater/functions || exit 1 # Contributor Covenant: A Code of Conduct for Open Source Projects function templater_conduct { if [ ! -e "CODE_OF_CONDUCT.md" ]; then - __templater_echo "Setting up Code of Conduct..." + templater_echo "Setting up Code of Conduct..." cp $SHARE/conduct/files/CODE_OF_CONDUCT.md . else - __templater_echo "Code of Conduct already set" + templater_echo "Code of Conduct already set" fi } diff --git a/share/templater/drupal7/setup b/share/templater/drupal7/setup index 7684d03..968e23b 100755 --- a/share/templater/drupal7/setup +++ b/share/templater/drupal7/setup @@ -12,7 +12,7 @@ source $SHARE/templater/functions || exit 1 # Drupal7 implementation function templater_drupal7 { if [ ! -e 'settings.dev.php' ]; then - __templater_echo "Setting up Drupal 7..." + templater_echo "Setting up Drupal 7..." #if [ ! -e "Makefile" ]; then # cp $SHARE/drupal7/files/Makefile . @@ -29,7 +29,7 @@ function templater_drupal7 { mkdir -p files themes modules libraries mkdir -p vendor else - __templater_echo "Drupal already set" + templater_echo "Drupal already set" fi } diff --git a/share/templater/drupal8/setup b/share/templater/drupal8/setup index fde815e..f9c8dfc 100755 --- a/share/templater/drupal8/setup +++ b/share/templater/drupal8/setup @@ -12,7 +12,7 @@ source $SHARE/templater/functions || exit 1 # Drupal8 implementation function templater_drupal8 { if [ ! -e 'settings.php' ]; then - __templater_echo "Setting up Drupal 8..." + templater_echo "Setting up Drupal 8..." if [ ! -e ".gitignore" ] || ! grep -q "^settings.php" .gitignore; then echo settings.php >> .gitignore @@ -36,7 +36,7 @@ function templater_drupal8 { ln -sf services.dev.yml services.yml - __templater_install_makefile $SHARE/drupal8/files/Makefile.drupal8 + templater_install_makefile $SHARE/drupal8/files/Makefile.drupal8 if [ ! -e "drupal.make.yml" ]; then cp $SHARE/drupal8/files/drupal.make.yml . @@ -56,7 +56,7 @@ function templater_drupal8 { touch {files,config,themes,modules,libraries,vendor}/.empty git add -f {files,config/sync,themes,modules,libraries}/.empty else - __templater_echo "Drupal already set" + templater_echo "Drupal already set" fi } diff --git a/share/templater/git/setup b/share/templater/git/setup index de2b750..952e6ef 100755 --- a/share/templater/git/setup +++ b/share/templater/git/setup @@ -12,11 +12,11 @@ source $SHARE/templater/functions || exit 1 # Git implementation function templater_git { if [ ! -d ".git" ]; then - __templater_echo "Setting up git..." + templater_echo "Setting up git..." touch .gitignore - __templater_user_input GIT_USER User "-> Choose a git user name" - __templater_user_input GIT_EMAIL user@example.org "-> Choose a git email address" + templater_user_input GIT_USER User "-> Choose a git user name" + templater_user_input GIT_EMAIL user@example.org "-> Choose a git email address" git init git config user.name "$GIT_USER" @@ -24,7 +24,7 @@ function templater_git { git add . git commit -m "Initial import" else - __templater_echo "Git already set" + templater_echo "Git already set" fi } diff --git a/share/templater/gitflow/setup b/share/templater/gitflow/setup index 5f0eff7..9aab36b 100755 --- a/share/templater/gitflow/setup +++ b/share/templater/gitflow/setup @@ -13,18 +13,18 @@ source $SHARE/templater/functions || exit 1 function templater_gitflow { if ! grep -q '^\[gitflow' .git/config; then if ! git branch --list develop | grep -q develop; then - __templater_echo "Setting up git-flow..." + templater_echo "Setting up git-flow..." git branch develop if [ -e "/usr/lib/git-core/git-flow" ]; then echo "" - __templater_echo "Setting up git-flow..." + templater_echo "Setting up git-flow..." git flow init -d fi fi else - __templater_echo "Git flow already set" + templater_echo "Git flow already set" fi } diff --git a/share/templater/githooks/setup b/share/templater/githooks/setup index 6fae697..84c3f0e 100755 --- a/share/templater/githooks/setup +++ b/share/templater/githooks/setup @@ -14,11 +14,11 @@ function templater_githooks { # TODO: check if githooks are already set if [ -d ".git" ]; then if which git-hooks &> /dev/null; then - __templater_echo "Setting up git-hooks..." + templater_echo "Setting up git-hooks..." git hooks --install fi else - __templater_echo "Git hooks already set" + templater_echo "Git hooks already set" fi } diff --git a/share/templater/gpl/setup b/share/templater/gpl/setup index 3491e93..93151ce 100755 --- a/share/templater/gpl/setup +++ b/share/templater/gpl/setup @@ -12,10 +12,10 @@ source $SHARE/templater/functions || exit 1 # GPLv3 License function templater_gpl { if [ ! -e "LICENSE" ]; then - __templater_echo "Setting up GPLv3 License..." + templater_echo "Setting up GPLv3 License..." cp $SHARE/gpl/files/LICENSE . else - __templater_echo "LICENSE already set" + templater_echo "LICENSE already set" fi } diff --git a/share/templater/hugo/setup b/share/templater/hugo/setup index bdc7285..8f9ce06 100755 --- a/share/templater/hugo/setup +++ b/share/templater/hugo/setup @@ -12,15 +12,15 @@ source $SHARE/templater/functions || exit 1 # Hugo implementation function templater_hugo { if [ ! -e "config.toml" ]; then - __templater_echo "Setting up Hugo..." + templater_echo "Setting up Hugo..." if which hugo &> /dev/null; then hugo new site . else - __templater_echo "Hugo not available, please install it, skipping" + templater_echo "Hugo not available, please install it, skipping" fi else - __templater_echo "Hugo already set" + templater_echo "Hugo already set" fi } diff --git a/share/templater/ikiwiki/setup b/share/templater/ikiwiki/setup index 68fad55..49edcd2 100755 --- a/share/templater/ikiwiki/setup +++ b/share/templater/ikiwiki/setup @@ -12,10 +12,10 @@ source $SHARE/templater/functions || exit 1 # Ikiwiki implementation function templater_ikiwiki { if [ ! -e "ikiwiki.yaml" ]; then - __templater_echo "Setting up ikiwiki..." + templater_echo "Setting up ikiwiki..." - #__templater_checkout_develop - __templater_copy_or_append ikiwiki .gitignore + #templater_checkout_develop + templater_copy_or_append ikiwiki .gitignore #if [ ! -e "index.md" ]; then # cp $SHARE/ikiwiki/files/index.md . @@ -26,7 +26,7 @@ function templater_ikiwiki { cp $SHARE/ikiwiki/files/ikiwiki.yaml. fi - __templater_install_makefile $SHARE/ikiwiki/files/Makefile.ikiwiki + templater_install_makefile $SHARE/ikiwiki/files/Makefile.ikiwiki if [ ! -d "templates" ]; then cp -r $SHARE/ikiwiki/files/templates . @@ -41,7 +41,7 @@ function templater_ikiwiki { # git commit -a -m "Static site generation support using ikiwiki" #fi else - __templater_echo "Ikiwiki already set" + templater_echo "Ikiwiki already set" fi } diff --git a/share/templater/jekyll/setup b/share/templater/jekyll/setup index 43e940d..ad2660c 100755 --- a/share/templater/jekyll/setup +++ b/share/templater/jekyll/setup @@ -12,15 +12,15 @@ source $SHARE/templater/functions || exit 1 # Jekyll implementation function templater_jekyll { if [ ! -e "_config.yml" ]; then - __templater_echo "Setting up Jekyll..." + templater_echo "Setting up Jekyll..." if which jekyll &> /dev/null; then jekyll new . else - __templater_echo "Jekyll not available, please install it, skipping" + templater_echo "Jekyll not available, please install it, skipping" fi else - __templater_echo "Jekyll already set" + templater_echo "Jekyll already set" fi } diff --git a/share/templater/kvmx/setup b/share/templater/kvmx/setup index 8b3443f..9e9f70b 100755 --- a/share/templater/kvmx/setup +++ b/share/templater/kvmx/setup @@ -12,11 +12,11 @@ source $SHARE/templater/functions || exit 1 # KVMX implementation function templater_kvmx { if [ ! -e "kvmxfile" ]; then - __templater_echo "Setting up kvmx..." + templater_echo "Setting up kvmx..." kvmx init #git commit -a -m "Adds kvmx support" else - __templater_echo "KVMX already set" + templater_echo "KVMX already set" fi } diff --git a/share/templater/mit/setup b/share/templater/mit/setup index ce35adc..a80cf0b 100755 --- a/share/templater/mit/setup +++ b/share/templater/mit/setup @@ -12,10 +12,10 @@ source $SHARE/templater/functions || exit 1 # MIT License function templater_mit { if [ ! -e "LICENSE" ]; then - __templater_echo "Setting up MIT License..." + templater_echo "Setting up MIT License..." cp $SHARE/mit/files/LICENSE . else - __templater_echo "LICENSE already set" + templater_echo "LICENSE already set" fi } diff --git a/share/templater/mpl/setup b/share/templater/mpl/setup index 437c8f1..b12b951 100755 --- a/share/templater/mpl/setup +++ b/share/templater/mpl/setup @@ -12,10 +12,10 @@ source $SHARE/templater/functions || exit 1 # Mozilla License function templater_mpl { if [ ! -e "LICENSE" ]; then - __templater_echo "Setting up Mozilla Public License..." + templater_echo "Setting up Mozilla Public License..." cp $SHARE/mpl/files/LICENSE . else - __templater_echo "LICENSE already set" + templater_echo "LICENSE already set" fi } diff --git a/share/templater/pelican/setup b/share/templater/pelican/setup index 71929e7..abf106a 100755 --- a/share/templater/pelican/setup +++ b/share/templater/pelican/setup @@ -12,20 +12,20 @@ source $SHARE/templater/functions || exit 1 # Pelican implementation function templater_pelican { if [ ! -e "pelicanconf.py" ]; then - __templater_echo "Setting up pelican..." + templater_echo "Setting up pelican..." - #__templater_checkout_develop - __templater_copy_or_append pelican .gitignore + #templater_checkout_develop + templater_copy_or_append pelican .gitignore cp $SHARE/sphinx/files/pelicanconf.py . - __templater_install_makefile $SHARE/pelican/files/Makefile.pelican + templater_install_makefile $SHARE/pelican/files/Makefile.pelican if [ ! -d "content" ]; then cp -r $SHARE/pelican/files/content . fi else - __templater_echo "Pelican already set" + templater_echo "Pelican already set" fi } diff --git a/share/templater/puppet/setup b/share/templater/puppet/setup index bb8634b..402558c 100755 --- a/share/templater/puppet/setup +++ b/share/templater/puppet/setup @@ -14,15 +14,15 @@ source $SHARE/templater/functions || exit 1 # Puppet implementation function templater_puppet { if [ ! -d "puppet" ]; then - __templater_echo "Setting up puppet..." + templater_echo "Setting up puppet..." if [ ! -d '.git' ]; then - __templater_echo "Error: puppet needs a working git setup, skipping" + templater_echo "Error: puppet needs a working git setup, skipping" return fi if [ "`git status -s | wc -l`" != 0 ]; then - __templater_echo "Please commit changes before running setting up puppet" + templater_echo "Please commit changes before running setting up puppet" return fi @@ -37,7 +37,7 @@ function templater_puppet { cp puppet/config/node/box.example.org.yaml puppet/config/node/$PROJECT.example.org.yaml fi else - __templater_echo "Puppet already set" + templater_echo "Puppet already set" fi } diff --git a/share/templater/puppet_module/setup b/share/templater/puppet_module/setup index d06f1dd..5e779ec 100755 --- a/share/templater/puppet_module/setup +++ b/share/templater/puppet_module/setup @@ -13,14 +13,14 @@ source $SHARE/templater/functions || exit 1 # Puppet module function templater_puppet_module { if [ ! -e "manifests/init.pp" ]; then - __templater_echo "Setting up Puppet Module..." + templater_echo "Setting up Puppet Module..." mkdir -p manifests echo "class $PROJECT {" > manifests/init.pp echo "}" >> manifests/init.pp else - __templater_echo "Puppet Module already set" + templater_echo "Puppet Module already set" fi } diff --git a/share/templater/pushtodeploy/setup b/share/templater/pushtodeploy/setup index b7c3c67..1282bcc 100755 --- a/share/templater/pushtodeploy/setup +++ b/share/templater/pushtodeploy/setup @@ -12,7 +12,7 @@ source $SHARE/templater/functions || exit 1 # pushtodeploy implementation function templater_pushtodeploy { if [ ! -e "bin/post-receive" ]; then - __templater_echo "Setting up pushtodeploy..." + templater_echo "Setting up pushtodeploy..." mkdir -p bin cp $SHARE/pushtodeploy/files/post-receive bin/ @@ -24,7 +24,7 @@ function templater_pushtodeploy { fi fi else - __templater_echo "pushtodeploy already set" + templater_echo "pushtodeploy already set" fi } diff --git a/share/templater/sphinx/setup b/share/templater/sphinx/setup index b378ac3..04d5007 100755 --- a/share/templater/sphinx/setup +++ b/share/templater/sphinx/setup @@ -12,14 +12,14 @@ source $SHARE/templater/functions || exit 1 # Sphinx implementation function templater_sphinx { if [ ! -e "conf.py" ]; then - __templater_echo "Setting up sphinx..." + templater_echo "Setting up sphinx..." - #__templater_checkout_develop - __templater_copy_or_append sphinx .gitignore + #templater_checkout_develop + templater_copy_or_append sphinx .gitignore cp $SHARE/sphinx/files/conf.py . - __templater_install_makefile $SHARE/sphinx/files/Makefile.sphinx + templater_install_makefile $SHARE/sphinx/files/Makefile.sphinx if [ ! -d "_static" ]; then cp -r $SHARE/sphinx/files/_static . @@ -30,7 +30,7 @@ function templater_sphinx { git submodule add https://github.com/snide/sphinx_rtd_theme _themes/sphinx_rtd_theme fi else - __templater_echo "Sphinx already set" + templater_echo "Sphinx already set" fi } diff --git a/share/templater/templater/functions b/share/templater/templater/functions index 47c240b..b8658d2 100644 --- a/share/templater/templater/functions +++ b/share/templater/templater/functions @@ -4,15 +4,15 @@ # # Initialize project -function __templater_init { +function templater_init { if [ ! -d "$PROJECT" ]; then - __templater_echo "Initializing $PROJECT..." + templater_echo "Initializing $PROJECT..." mkdir -p $PROJECT fi } # Read a parameter from user -function __templater_ask { +function templater_ask { local input local function="$1" local default="n" @@ -26,27 +26,27 @@ function __templater_ask { } # Return list of implementations -function __templater_implementations { +function templater_implementations { # Do not sort this list: the order in which functions are present in the code is important #grep "^function templater_" $PROGRAM | cut -d ' ' -f 2 | sed -e 's/templater_//' ls $SHARE } # Message -function __templater_echo { +function templater_echo { #echo "" echo "-> $*" } # Checkout to develop branch if available -function __templater_checkout_develop { +function templater_checkout_develop { if git branch --list develop | grep -q develop; then git checkout develop fi } # Copy or append source file into destination -function __templater_copy_or_append { +function templater_copy_or_append { local implementation="$1" local file="$2" @@ -62,7 +62,7 @@ function __templater_copy_or_append { } # Read a parameter from user -function __templater_user_input { +function templater_user_input { local input local param="$1" local default="$2" @@ -82,7 +82,7 @@ function __templater_user_input { } # Install the global Makefile -function __templater_install_makefile { +function templater_install_makefile { if [ -z "$1" ]; then return fi diff --git a/share/templater/templater/setup b/share/templater/templater/setup index fd26e5c..14050e3 100755 --- a/share/templater/templater/setup +++ b/share/templater/templater/setup @@ -12,13 +12,13 @@ source $SHARE/templater/functions || exit 1 # Templater module function templater_templater { if [ ! -e "description" ]; then - __templater_echo "Setting Templater Module" + templater_echo "Setting Templater Module" touch setup description chmod +x setup mkdir files else - __templater_echo "Templater Module already set" + templater_echo "Templater Module already set" fi } diff --git a/share/templater/trashman/setup b/share/templater/trashman/setup index 6d4ae55..f11bc27 100755 --- a/share/templater/trashman/setup +++ b/share/templater/trashman/setup @@ -12,12 +12,12 @@ source $SHARE/templater/functions || exit 1 # Templater module function templater_trashman { if [ ! -e "description" ]; then - __templater_echo "Setting Trashman package" + templater_echo "Setting Trashman package" touch info mkdir unix else - __templater_echo "Trashman package already set" + templater_echo "Trashman package already set" fi } diff --git a/share/templater/vagrant/setup b/share/templater/vagrant/setup index 0550034..7b39cc2 100755 --- a/share/templater/vagrant/setup +++ b/share/templater/vagrant/setup @@ -12,13 +12,13 @@ source $SHARE/templater/functions || exit 1 # Vagrant implementation function templater_vagrant { if [ ! -e "Vagrantfile" ]; then - __templater_echo "Setting up vagrant..." - #__templater_checkout_develop + templater_echo "Setting up vagrant..." + #templater_checkout_develop vagrant init echo '.vagrant' >> .gitignore #git commit -a -m "Adds vagrant support" else - __templater_echo "Vagrant already set" + templater_echo "Vagrant already set" fi } diff --git a/share/templater/wtfpl/setup b/share/templater/wtfpl/setup index ff34118..12b589f 100755 --- a/share/templater/wtfpl/setup +++ b/share/templater/wtfpl/setup @@ -12,10 +12,10 @@ source $SHARE/templater/functions || exit 1 # Do What the Fuck You Want to Public License - WTFPL function templater_wtfpl { if [ ! -e "LICENSE" ]; then - __templater_echo "Setting up Do What the Fuck You Want Public License..." + templater_echo "Setting up Do What the Fuck You Want Public License..." cp $SHARE/wtfpl/files/LICENSE . else - __templater_echo "LICENSE already set" + templater_echo "LICENSE already set" fi } |