* Be verbose about the need to review and edit files, adding LICENSE headers into source files, etc
* Try an alternative command-line format, like "module:option1=value,option2=value with spaces"
* Git: optionally configure user.signingkey, commit.gpgsign, etc
- * Makefile
* Debian package
+ * Update and diff modes to compare/update configs between a project and templater's defaults
# Include local customizations/overrides, which might be .gitignore'd
# See https://www.gnu.org/software/make/manual/html_node/Include.html
--include Makefile.local
+#-include Makefile.local
# Setup production environment
production: submodules post_receive drush settings ownership
echo sql >> .gitignore
fi
- if ! grep -q "^Makefile.local" .gitignore; then
- echo Makefile.local >> .gitignore
- fi
-
if [ ! -e "settings.dev.php" ]; then
cp $SHARE/drupal8/files/default.settings.php settings.dev.php
#cp $SHARE/drupal8/files/default.settings.php .
ln -sf services.dev.yml services.yml
- if [ ! -e "Makefile" ]; then
- cp $SHARE/drupal8/files/Makefile .
- #elif ! grep -q ^drupal: Makefile; then
- # grep -v '^#' $SHARE/drupal8/files/Makefile >> Makefile
- else
- cp $SHARE/drupal8/files/Makefile Makefile.drupal8
- fi
+ __templater_install_makefile $SHARE/drupal8/files/Makefile.drupal8
if [ ! -e "drupal.make.yml" ]; then
cp $SHARE/drupal8/files/drupal.make.yml .
cp $SHARE/ikiwiki/files/ikiwiki.yaml.
fi
- if [ ! -e "Makefile" ]; then
- cp $SHARE/ikiwiki/files/Makefile .
- #elif ! grep -q ^wiki: Makefile; then
- # grep -v '^#' $SHARE/ikiwiki/files/Makefile >> Makefile
- else
- cp $SHARE/ikiwiki/files/Makefile Makefile.ikiwiki
- fi
+ __templater_install_makefile $SHARE/ikiwiki/files/Makefile.ikiwiki
if [ ! -d "templates" ]; then
cp -r $SHARE/ikiwiki/files/templates .
cp $SHARE/sphinx/files/pelicanconf.py .
- if [ ! -e "Makefile" ]; then
- cp $SHARE/pelican/files/Makefile .
- #elif ! grep -q pelican Makefile; then
- # grep -v '^#' $SHARE/pelican/files/Makefile >> Makefile
- else
- cp $SHARE/ikiwiki/files/Makefile Makefile.pelican
- fi
+ __templater_install_makefile $SHARE/pelican/files/Makefile.pelican
if [ ! -d "content" ]; then
cp -r $SHARE/pelican/files/content .
cp $SHARE/sphinx/files/conf.py .
- if [ ! -e "Makefile" ]; then
- cp $SHARE/sphinx/files/Makefile .
- #elif ! grep -q sphinx Makefile; then
- # grep -v '^#' $SHARE/sphinx/files/Makefile >> Makefile
- else
- cp $SHARE/ikiwiki/files/Makefile Makefile.sphinx
- fi
+ __templater_install_makefile $SHARE/sphinx/files/Makefile.sphinx
if [ ! -d "_static" ]; then
cp -r $SHARE/sphinx/files/_static .
--- /dev/null
+#
+# Global Makefile - https://templater.fluxo.info
+#
+# This Makefile contains basic, common targets and also includes
+# any Makefile.* available in the current folder.
+#
+
+# See http://unix.stackexchange.com/questions/32182/simple-command-line-http-server#32200
+# http://php.net/manual/en/features.commandline.webserver.php
+serve:
+ python -m SimpleHTTPServer
+ # Or the Python 3 equivalent
+ #python3 -m http.server
+ #php -S localhost:8000
+
+# Process any other Makefile whose filename matches Makefile.*
+# See https://www.gnu.org/software/make/manual/html_node/Include.html
+-include Makefile.*
fi
}
+# Install the global Makefile
+function __templater_install_makefile {
+ if [ -z "$1" ]; then
+ return
+ fi
+
+ local src="$1"
+ local name="`basename $src`"
+
+ # First ensure we have the main Makefile
+ if [ ! -e "Makefile" ]; then
+ cp $SHARE/templater/files/Makefile .
+ fi
+
+ # Then copy the custom Makefile
+ if [ ! -e "$name" ]; then
+ cp $src .
+ fi
+
+ #if ! grep -q "^Makefile.local" .gitignore; then
+ # echo Makefile.local >> .gitignore
+ #fi
+}