diff --git a/docs/getting_started.rst b/docs/getting_started.rst index 593b2e35..f302d8d7 100644 --- a/docs/getting_started.rst +++ b/docs/getting_started.rst @@ -271,6 +271,12 @@ use rsync over ssh:: That's it! Your site should now be live. +(The default ``Makefile`` and ``devserver.sh`` scripts use the ``python`` and +``pelican`` executables to complete its tasks. If you want to use different +executables, such as ``python3``, you can set the ``PY`` and ``PELICAN`` +environment variables, respectively, to override the default executable names.) + + Writing content using Pelican ============================= diff --git a/pelican/tools/pelican_quickstart.py b/pelican/tools/pelican_quickstart.py index b7ebd081..b24a508c 100755 --- a/pelican/tools/pelican_quickstart.py +++ b/pelican/tools/pelican_quickstart.py @@ -274,9 +274,9 @@ needed by Pelican. try: with codecs.open(os.path.join(CONF['basedir'], 'Makefile'), 'w', 'utf-8') as fd: mkfile_template_name = 'Makefile' - py_v = 'PY=python' + py_v = 'PY?=python' if six.PY3: - py_v = 'PY=python3' + py_v = 'PY?=python3' template = string.Template(py_v) fd.write(template.safe_substitute(CONF)) fd.write('\n') @@ -296,9 +296,9 @@ needed by Pelican. try: with codecs.open(os.path.join(CONF['basedir'], 'develop_server.sh'), 'w', 'utf-8') as fd: lines = list(get_template('develop_server.sh')) - py_v = 'PY=python\n' + py_v = 'PY=${PY:-python}\n' if six.PY3: - py_v = 'PY=python3\n' + py_v = 'PY=${PY:-python3}\n' lines = lines[:4] + [py_v] + lines[4:] for line in lines: template = string.Template(line) diff --git a/pelican/tools/templates/Makefile.in b/pelican/tools/templates/Makefile.in index 38b8b82a..fe7a60a4 100644 --- a/pelican/tools/templates/Makefile.in +++ b/pelican/tools/templates/Makefile.in @@ -1,4 +1,4 @@ -PELICAN=$pelican +PELICAN?=$pelican PELICANOPTS=$pelicanopts BASEDIR=$$(CURDIR) diff --git a/pelican/tools/templates/develop_server.sh.in b/pelican/tools/templates/develop_server.sh.in index 195d9d6e..4259af5b 100755 --- a/pelican/tools/templates/develop_server.sh.in +++ b/pelican/tools/templates/develop_server.sh.in @@ -2,7 +2,7 @@ ## # This section should match your Makefile ## -PELICAN=$pelican +PELICAN=$${PELICAN:-$pelican} PELICANOPTS=$pelicanopts BASEDIR=$$(pwd)