From 971799f1301bc06665dbd7b75ee9f3972e8067e2 Mon Sep 17 00:00:00 2001 From: deadc0de6 Date: Sun, 21 Aug 2022 23:19:57 +0200 Subject: [PATCH 01/14] badge on master branch only --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 30f93c2..9668714 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ [![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](http://www.gnu.org/licenses/gpl-3.0) [![GitHub Repo stars](https://img.shields.io/github/stars/deadc0de6/dotdrop?style=social)](https://github.com/deadc0de6/dotdrop/) -[![Tests Status](https://github.com/deadc0de6/dotdrop/workflows/tests/badge.svg)](https://github.com/deadc0de6/dotdrop/actions) +[![Tests Status](https://github.com/deadc0de6/dotdrop/workflows/tests/badge.svg?branch=master)](https://github.com/deadc0de6/dotdrop/actions) [![Doc Status](https://readthedocs.org/projects/dotdrop/badge/?version=latest)](https://dotdrop.readthedocs.io/en/latest/?badge=latest) [![Coveralls](https://img.shields.io/coveralls/github/deadc0de6/dotdrop)](https://coveralls.io/github/deadc0de6/dotdrop?branch=master) [![LGTM Grade](https://img.shields.io/lgtm/grade/python/github/deadc0de6/dotdrop?label=code%20quality)](https://lgtm.com/projects/g/deadc0de6/dotdrop/context:python) From d9247f9d4bb6a8e4da30e106ec0cdfebea87b178 Mon Sep 17 00:00:00 2001 From: deadc0de6 Date: Mon, 22 Aug 2022 21:16:34 +0200 Subject: [PATCH 02/14] add variable enrichment --- dotdrop/cfg_aggregator.py | 61 +++++++++++++++ tests-ng/variables-enrich.sh | 142 +++++++++++++++++++++++++++++++++++ 2 files changed, 203 insertions(+) create mode 100755 tests-ng/variables-enrich.sh diff --git a/dotdrop/cfg_aggregator.py b/dotdrop/cfg_aggregator.py index 01f1125..780dd74 100644 --- a/dotdrop/cfg_aggregator.py +++ b/dotdrop/cfg_aggregator.py @@ -7,6 +7,7 @@ handle higher level of the config file import os import shlex +import platform # local imports @@ -29,6 +30,12 @@ class CfgAggregator: file_prefix = 'f' dir_prefix = 'd' + variable_os = 'os' + variable_release = 'release' + variable_distro_id = 'distro_id' + variable_distro_like = 'distro_like' + variable_distro_version = 'distro_version' + def __init__(self, path, profile_key, debug=False, dry=False): """ high level config parser @@ -283,6 +290,8 @@ class CfgAggregator: self.variables = self.cfgyaml.variables debug_dict('variables', self.variables, self.debug) + self._enrich_variables() + # patch dotfiles in profiles self._patch_keys_to_objs(self.profiles, "dotfiles", self.get_dotfile) @@ -311,6 +320,58 @@ class CfgAggregator: self._get_trans_w_args(self.get_trans_w), islist=False) + def _enrich_variables(self): + """ + enrich available variables + """ + if self.variable_os not in self.variables: + # enrich with os variable + # https://docs.python.org/3/library/platform.html#platform.system + var_os = platform.system().lower() + self.variables[self.variable_os] = var_os + msg = 'enrich variables with {}={}' + self.log.dbg(msg.format(self.variable_os, var_os)) + if self.variable_release not in self.variables: + # enrich with release variable + # https://docs.python.org/3/library/platform.html#platform.release + var_release = platform.release().lower() + self.variables[self.variable_release] = var_release + msg = 'enrich variables with {}={}' + self.log.dbg(msg.format(self.variable_release, var_release)) + + has_distro = True + try: + import distro + assert distro + except ImportError as exc: + self.log.dbg('distro packages not found!') + has_distro = False + + if has_distro and self.variable_distro_id not in self.variables: + # enrich with distro variable + # https://pypi.org/project/distro/ + # https://distro.readthedocs.io/en/latest/#distro.id + var_distro_id = distro.id().lower() + self.variables[self.variable_distro_id] = var_distro_id + msg = 'enrich variables with {}={}' + self.log.dbg(msg.format(self.variable_distro_id, var_distro_id)) + if has_distro and self.variable_distro_version not in self.variables: + # enrich with distro variable + # https://pypi.org/project/distro/ + # https://distro.readthedocs.io/en/latest/#distro.version + var_version = distro.version().lower() + self.variables[self.variable_distro_version] = var_version + msg = 'enrich variables with {}={}' + self.log.dbg(msg.format(self.variable_distro_version, var_version)) + if has_distro and self.variable_distro_like not in self.variables: + # enrich with distro variable + # https://pypi.org/project/distro/ + # https://distro.readthedocs.io/en/latest/#distro.like + var_like = distro.like().lower() + self.variables[self.variable_distro_like] = var_like + msg = 'enrich variables with {}={}' + self.log.dbg(msg.format(self.variable_distro_like, var_like)) + def _patch_keys_to_objs(self, containers, keys, get_by_key, islist=True): """ map for each key in the attribute 'keys' in 'containers' diff --git a/tests-ng/variables-enrich.sh b/tests-ng/variables-enrich.sh new file mode 100755 index 0000000..3a45ed9 --- /dev/null +++ b/tests-ng/variables-enrich.sh @@ -0,0 +1,142 @@ +#!/usr/bin/env bash +# author: deadc0de6 (https://github.com/deadc0de6) +# Copyright (c) 2022, deadc0de6 +# +# test variables enrichment +# returns 1 in case of error +# + +# exit on first error +set -e + +# all this crap to get current path +rl="readlink -f" +if ! ${rl} "${0}" >/dev/null 2>&1; then + rl="realpath" + + if ! hash ${rl}; then + echo "\"${rl}\" not found !" && exit 1 + fi +fi +cur=$(dirname "$(${rl} "${0}")") + +#hash dotdrop >/dev/null 2>&1 +#[ "$?" != "0" ] && echo "install dotdrop to run tests" && exit 1 + +#echo "called with ${1}" + +# dotdrop path can be pass as argument +ddpath="${cur}/../" +[ "${1}" != "" ] && ddpath="${1}" +[ ! -d ${ddpath} ] && echo "ddpath \"${ddpath}\" is not a directory" && exit 1 + +export PYTHONPATH="${ddpath}:${PYTHONPATH}" +bin="python3 -m dotdrop.dotdrop" +hash coverage 2>/dev/null && bin="coverage run -a --source=dotdrop -m dotdrop.dotdrop" || true + +echo "dotdrop path: ${ddpath}" +echo "pythonpath: ${PYTHONPATH}" + +# get the helpers +source ${cur}/helpers + +echo -e "$(tput setaf 6)==> RUNNING $(basename $BASH_SOURCE) <==$(tput sgr0)" + +################################################################ +# this is the test +################################################################ + +# the dotfile source +tmps=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` +mkdir -p ${tmps}/dotfiles + +# the dotfile destination +tmpd=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` + +clear_on_exit "${tmps}" +clear_on_exit "${tmpd}" + +# create the config file +cfg="${tmps}/config.yaml" +export dotdrop_test_dst="${tmpd}/def" + +cat > ${cfg} << _EOF +config: + backup: true + create: true + dotpath: dotfiles +dotfiles: + f_abc: + dst: ${tmpd}/abc + src: abc +profiles: + p1: + dotfiles: + - f_abc +_EOF +#cat ${cfg} + +# create the dotfile +echo "os={{@@ os @@}}" > ${tmps}/dotfiles/abc +echo "release={{@@ release @@}}" >> ${tmps}/dotfiles/abc +echo "distro_id={{@@ distro_id @@}}" >> ${tmps}/dotfiles/abc +echo "distro_like={{@@ distro_like @@}}" >> ${tmps}/dotfiles/abc +echo "distro_version={{@@ distro_version @@}}" >> ${tmps}/dotfiles/abc + +# install +cd ${ddpath} | ${bin} install -f -c ${cfg} -p p1 --verbose + +pybin="python3" +real_os=$(${pybin} -c 'import platform; print(platform.system().lower())') +real_release=$(${pybin} -c 'import platform; print(platform.release().lower())') +real_distro_id=$(${pybin} -c 'import distro; print(distro.id().lower())') +real_distro_like=$(${pybin} -c 'import distro; print(distro.like().lower())') +real_distro_version=$(${pybin} -c 'import distro; print(distro.version().lower())') + +# tests +[ ! -e ${tmpd}/abc ] && echo "abc not installed" && exit 1 +cat "${tmpd}/abc" + ## only test this on CI/CD +grep "^os=${real_os}" ${tmpd}/abc >/dev/null +grep "^release=${real_release}" ${tmpd}/abc >/dev/null +grep "^distro_id=${real_distro_id}" ${tmpd}/abc >/dev/null +grep "^distro_like=${real_distro_like}" ${tmpd}/abc >/dev/null +grep "^distro_version=${real_distro_version}" ${tmpd}/abc >/dev/null + +# already defined variables +cat > ${cfg} << _EOF +config: + backup: true + create: true + dotpath: dotfiles +variables: + os: "abc" + release: "def" + distro_id: "ghi" + distro_like: "jkl" + distro_version: "mno" +dotfiles: + f_abc: + dst: ${tmpd}/abc + src: abc +profiles: + p1: + dotfiles: + - f_abc +_EOF +rm -f "${tmpd}/abc" + +# install +cd ${ddpath} | ${bin} install -f -c ${cfg} -p p1 --verbose + +# tests +[ ! -e ${tmpd}/abc ] && echo "abc not installed" && exit 1 +cat "${tmpd}/abc" +grep '^os=abc$' ${tmpd}/abc >/dev/null +grep '^release=def$' ${tmpd}/abc >/dev/null +grep '^distro_id=ghi$' ${tmpd}/abc >/dev/null +grep '^distro_like=jkl$' ${tmpd}/abc >/dev/null +grep '^distro_version=mno$' ${tmpd}/abc >/dev/null + +echo "OK" +exit 0 From 313db43c32eede4f450bd2cdaed74c26c587b1d6 Mon Sep 17 00:00:00 2001 From: deadc0de6 Date: Mon, 22 Aug 2022 21:16:43 +0200 Subject: [PATCH 03/14] update requirements --- requirements.txt | 1 + tests-requirements.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/requirements.txt b/requirements.txt index c10954d..0ef2e31 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,3 +5,4 @@ python-magic; python_version > '3.4' packaging; python_version > '3.4' requests; python_version > '3.4' toml; python_version > '3.4' +distro; python_verison > '3.4' diff --git a/tests-requirements.txt b/tests-requirements.txt index 51c1488..ae92012 100644 --- a/tests-requirements.txt +++ b/tests-requirements.txt @@ -5,3 +5,4 @@ coveralls; python_version > '3.4' pyflakes; python_version > '3.4' pylint; python_version > '3.4' halo; python_version > '3.4' +distro; python_verison > '3.4' From a588df71ec45846a0b5530dc58eae03f2fa29a0e Mon Sep 17 00:00:00 2001 From: deadc0de6 Date: Mon, 22 Aug 2022 21:26:14 +0200 Subject: [PATCH 04/14] update arch package dependencies --- packages/arch-dotdrop-git/PKGBUILD | 2 +- packages/arch-dotdrop/PKGBUILD | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/arch-dotdrop-git/PKGBUILD b/packages/arch-dotdrop-git/PKGBUILD index 40aac22..3a6c344 100644 --- a/packages/arch-dotdrop-git/PKGBUILD +++ b/packages/arch-dotdrop-git/PKGBUILD @@ -9,7 +9,7 @@ arch=('any') url="https://github.com/deadc0de6/dotdrop" license=('GPL') groups=() -depends=('python' 'python-setuptools' 'python-jinja' 'python-docopt' 'python-ruamel-yaml' 'python-magic' 'python-requests' 'python-packaging' 'python-toml') +depends=('python' 'python-setuptools' 'python-jinja' 'python-docopt' 'python-ruamel-yaml' 'python-magic' 'python-requests' 'python-packaging' 'python-toml' 'python-distro') makedepends=('git') provides=(dotdrop) conflicts=(dotdrop) diff --git a/packages/arch-dotdrop/PKGBUILD b/packages/arch-dotdrop/PKGBUILD index 3032048..b354c44 100644 --- a/packages/arch-dotdrop/PKGBUILD +++ b/packages/arch-dotdrop/PKGBUILD @@ -8,7 +8,7 @@ arch=('any') url="https://github.com/deadc0de6/dotdrop" license=('GPL') groups=() -depends=('python' 'python-setuptools' 'python-jinja' 'python-docopt' 'python-ruamel-yaml' 'python-magic' 'python-requests' 'python-packaging' 'python-toml') +depends=('python' 'python-setuptools' 'python-jinja' 'python-docopt' 'python-ruamel-yaml' 'python-magic' 'python-requests' 'python-packaging' 'python-toml' 'python-distro') makedepends=('git') source=("git+https://github.com/deadc0de6/dotdrop.git#tag=v${pkgver}") md5sums=('SKIP') From 19e4450536e8acd826566ae652584a634f34a54d Mon Sep 17 00:00:00 2001 From: deadc0de6 Date: Mon, 22 Aug 2022 21:26:26 +0200 Subject: [PATCH 05/14] pypi dependencies --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 87d03ec..69d5dce 100644 --- a/setup.py +++ b/setup.py @@ -42,7 +42,7 @@ setup( keywords='dotfiles jinja2', packages=find_packages(exclude=['tests*']), - install_requires=['docopt', 'Jinja2', 'ruamel.yaml', 'python-magic', 'packaging', 'requests', 'toml'], + install_requires=['docopt', 'Jinja2', 'ruamel.yaml', 'python-magic', 'packaging', 'requests', 'toml', 'distro'], extras_require={ 'dev': ['check-manifest'], From 61509743670e41012af6960677ad02eaf1b68ad6 Mon Sep 17 00:00:00 2001 From: deadc0de6 Date: Mon, 22 Aug 2022 21:26:38 +0200 Subject: [PATCH 06/14] documentation on enriched variables --- docs/templating.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/templating.md b/docs/templating.md index 4d147a1..e04d5c5 100644 --- a/docs/templating.md +++ b/docs/templating.md @@ -41,10 +41,22 @@ The following variables are available in templates: * `{{@@ _dotdrop_dotpath @@}}` contains the [dotpath](config-config.md) absolute path. * `{{@@ _dotdrop_cfgpath @@}}` contains the absolute path to the [config file](config-file.md). * `{{@@ _dotdrop_workdir @@}}` contains the [workdir](config-config.md) absolute path. +* The [enriched variables](#variables-enrichment) * Dotfile specific variables (see [Dotfile variables](#dotfile-variables)) * All defined config variables (see [Variables](config-file.md#variables)) * All defined config interpreted variables (see [Interpreted variables](config-dynvars.md#dynvariables-entry)) +## Variables enrichment + +The below variables are added to the available variables withins. If the variable +is already set by the user (through the config file for example), it will not be overwritten. + +* `os`: will contain the OS name as provided by +* `release`: will contain the OS release version as provided by +* `distro_id`: will contain the distribution ID as provided by +* `distro_version`: will contain the distribution version as provided by +* `distro_like`: will contain a space-separated list of distro IDs that are closely related to the current OS distro as provided by + ## Dotfile variables When a dotfile is handled by dotdrop, the following variables are also available for templating: From aac3e608adc2d04dd7c1c24e7428215266884845 Mon Sep 17 00:00:00 2001 From: deadc0de6 Date: Mon, 22 Aug 2022 21:26:46 +0200 Subject: [PATCH 07/14] test distro dependency --- dotdrop/utils.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dotdrop/utils.py b/dotdrop/utils.py index 6047ede..9878cde 100644 --- a/dotdrop/utils.py +++ b/dotdrop/utils.py @@ -389,6 +389,13 @@ def dependencies_met(): assert toml except ImportError as exc: raise Exception(err.format('toml')) from exc + + # distro + try: + import distro + assert distro + except ImportError as exc: + raise Exception(err.format('distro')) from exc # pylint: enable=C0415 From b4769c015eeaa087c94646896f62eb6245b9d885 Mon Sep 17 00:00:00 2001 From: deadc0de6 Date: Mon, 22 Aug 2022 21:27:44 +0200 Subject: [PATCH 08/14] fix requirements --- requirements.txt | 2 +- tests-requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index 0ef2e31..d74adb6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,4 +5,4 @@ python-magic; python_version > '3.4' packaging; python_version > '3.4' requests; python_version > '3.4' toml; python_version > '3.4' -distro; python_verison > '3.4' +distro; python_version > '3.4' diff --git a/tests-requirements.txt b/tests-requirements.txt index ae92012..a68debc 100644 --- a/tests-requirements.txt +++ b/tests-requirements.txt @@ -5,4 +5,4 @@ coveralls; python_version > '3.4' pyflakes; python_version > '3.4' pylint; python_version > '3.4' halo; python_version > '3.4' -distro; python_verison > '3.4' +distro; python_version > '3.4' From 065a039940c732f1176b3ca50066f64b9d7ae7b3 Mon Sep 17 00:00:00 2001 From: deadc0de6 Date: Mon, 22 Aug 2022 21:30:59 +0200 Subject: [PATCH 09/14] linting --- dotdrop/cfg_aggregator.py | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/dotdrop/cfg_aggregator.py b/dotdrop/cfg_aggregator.py index 780dd74..afc6990 100644 --- a/dotdrop/cfg_aggregator.py +++ b/dotdrop/cfg_aggregator.py @@ -8,6 +8,7 @@ handle higher level of the config file import os import shlex import platform +import distro # local imports @@ -338,16 +339,7 @@ class CfgAggregator: self.variables[self.variable_release] = var_release msg = 'enrich variables with {}={}' self.log.dbg(msg.format(self.variable_release, var_release)) - - has_distro = True - try: - import distro - assert distro - except ImportError as exc: - self.log.dbg('distro packages not found!') - has_distro = False - - if has_distro and self.variable_distro_id not in self.variables: + if self.variable_distro_id not in self.variables: # enrich with distro variable # https://pypi.org/project/distro/ # https://distro.readthedocs.io/en/latest/#distro.id @@ -355,7 +347,7 @@ class CfgAggregator: self.variables[self.variable_distro_id] = var_distro_id msg = 'enrich variables with {}={}' self.log.dbg(msg.format(self.variable_distro_id, var_distro_id)) - if has_distro and self.variable_distro_version not in self.variables: + if self.variable_distro_version not in self.variables: # enrich with distro variable # https://pypi.org/project/distro/ # https://distro.readthedocs.io/en/latest/#distro.version @@ -363,7 +355,7 @@ class CfgAggregator: self.variables[self.variable_distro_version] = var_version msg = 'enrich variables with {}={}' self.log.dbg(msg.format(self.variable_distro_version, var_version)) - if has_distro and self.variable_distro_like not in self.variables: + if self.variable_distro_like not in self.variables: # enrich with distro variable # https://pypi.org/project/distro/ # https://distro.readthedocs.io/en/latest/#distro.like From 70ddc0376975f0f293928ee7e3fdbc80c6d87c7f Mon Sep 17 00:00:00 2001 From: deadc0de6 Date: Mon, 22 Aug 2022 21:31:47 +0200 Subject: [PATCH 10/14] ignore coverage files --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 391638e..89ce7b3 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ .idea/ .vscode/ .atom/ +.coverage* dist/ build/ From 7a78960043e408eb83359e946323d3be7908029d Mon Sep 17 00:00:00 2001 From: deadc0de6 Date: Mon, 22 Aug 2022 22:53:26 +0200 Subject: [PATCH 11/14] update doc --- docs/templating.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/templating.md b/docs/templating.md index e04d5c5..7940f13 100644 --- a/docs/templating.md +++ b/docs/templating.md @@ -48,7 +48,7 @@ The following variables are available in templates: ## Variables enrichment -The below variables are added to the available variables withins. If the variable +The below variables are added to the available variables within templates. If the variable is already set by the user (through the config file for example), it will not be overwritten. * `os`: will contain the OS name as provided by From 2f7eacb7a9e659665a90041f25f144cf8611189a Mon Sep 17 00:00:00 2001 From: deadc0de6 Date: Mon, 22 Aug 2022 22:54:04 +0200 Subject: [PATCH 12/14] doc --- docs/templating.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/templating.md b/docs/templating.md index 7940f13..5bec520 100644 --- a/docs/templating.md +++ b/docs/templating.md @@ -49,13 +49,13 @@ The following variables are available in templates: ## Variables enrichment The below variables are added to the available variables within templates. If the variable -is already set by the user (through the config file for example), it will not be overwritten. +is already set by the user (through the config file for example) it will not be overwritten. -* `os`: will contain the OS name as provided by -* `release`: will contain the OS release version as provided by -* `distro_id`: will contain the distribution ID as provided by -* `distro_version`: will contain the distribution version as provided by -* `distro_like`: will contain a space-separated list of distro IDs that are closely related to the current OS distro as provided by +* `os` will contain the OS name as provided by +* `release` will contain the OS release version as provided by +* `distro_id` will contain the distribution ID as provided by +* `distro_version` will contain the distribution version as provided by +* `distro_like` will contain a space-separated list of distro IDs that are closely related to the current OS distro as provided by ## Dotfile variables From da764f39ad4f29fc23f7c6b81078732e5de1e9b9 Mon Sep 17 00:00:00 2001 From: deadc0de6 Date: Wed, 24 Aug 2022 20:53:30 +0200 Subject: [PATCH 13/14] catch undefined profile --- dotdrop/dotdrop.py | 3 +++ dotdrop/importer.py | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/dotdrop/dotdrop.py b/dotdrop/dotdrop.py index bf99e78..f7ba860 100644 --- a/dotdrop/dotdrop.py +++ b/dotdrop/dotdrop.py @@ -851,6 +851,9 @@ def _exec_command(opts): LOG.dbg('running cmd: {}'.format(command)) cmd_remove(opts) + except UndefinedException as exc: + LOG.err(exc) + ret = False except KeyboardInterrupt: LOG.err('interrupted') ret = False diff --git a/dotdrop/importer.py b/dotdrop/importer.py index ecbe2df..528bd43 100644 --- a/dotdrop/importer.py +++ b/dotdrop/importer.py @@ -16,6 +16,7 @@ from dotdrop.utils import strip_home, get_default_file_perms, \ from dotdrop.linktypes import LinkTypes from dotdrop.comparator import Comparator from dotdrop.templategen import Templategen +from dotdrop.exceptions import UndefinedException class Importer: @@ -35,8 +36,11 @@ class Importer: @debug: enable debug @keepdot: keep dot prefix @ignore: patterns to ignore when importing + This may raise UndefinedException """ self.profile = profile + if not self.profile: + raise UndefinedException("profile is undefined") self.conf = conf self.dotpath = dotpath self.diff_cmd = diff_cmd From 507c0b88cf34d1714489ab89fc98d3c182ef039b Mon Sep 17 00:00:00 2001 From: deadc0de6 Date: Thu, 25 Aug 2022 23:25:29 +0200 Subject: [PATCH 14/14] fix doc --- docs/templating.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/templating.md b/docs/templating.md index 5bec520..7e2661f 100644 --- a/docs/templating.md +++ b/docs/templating.md @@ -51,11 +51,11 @@ The following variables are available in templates: The below variables are added to the available variables within templates. If the variable is already set by the user (through the config file for example) it will not be overwritten. -* `os` will contain the OS name as provided by -* `release` will contain the OS release version as provided by -* `distro_id` will contain the distribution ID as provided by -* `distro_version` will contain the distribution version as provided by -* `distro_like` will contain a space-separated list of distro IDs that are closely related to the current OS distro as provided by +* `{{@@ os @@}}` will contain the OS name as provided by +* `{{@@ release @@}}` will contain the OS release version as provided by +* `{{@@ distro_id @@}}` will contain the distribution ID as provided by +* `{{@@ distro_version @@}}` will contain the distribution version as provided by +* `{{@@ distro_like @@}}` will contain a space-separated list of distro IDs that are closely related to the current OS distro as provided by ## Dotfile variables