From 5b02b4cc8de1737a6fe6183cef06419713e2b9b9 Mon Sep 17 00:00:00 2001 From: Daniel Roberts Date: Tue, 24 Jul 2018 12:42:17 -0400 Subject: [PATCH] Standardize help cache generation across environments long home directory paths (i.e. long usernames) otherwise cause different text wrap behavior --- Makefile | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index f40632284b..4847bfe6b6 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,18 @@ all : src/commcare_cloud/help_cache/ansible.txt src/commcare_cloud/help_cache/ansible-playbook.txt docs/commcare-cloud/commands/index.md + +# The length of the home directory affects +# how help text gets wrapped in ansible/ansible-playbook -h output. +# Pick a standard (but arbitrary) value for $HOME to be used across all environments. +# Make it short but unlikely to occur otherwise, so that we can safely find/replace it with ~. +# (Directly using escaped '~' does not work.) +STANDARD_HOME=/! + src/commcare_cloud/help_cache/ansible.txt: - ansible -h | sed "s|${HOME}|~|g" > src/commcare_cloud/help_cache/ansible.txt + COLUMNS=80 HOME="${STANDARD_HOME}" ansible -h | sed "s|${STANDARD_HOME}|~|g" > src/commcare_cloud/help_cache/ansible.txt src/commcare_cloud/help_cache/ansible-playbook.txt: - ansible-playbook -h | sed "s|${HOME}|~|g" > src/commcare_cloud/help_cache/ansible-playbook.txt + COLUMNS=80 HOME="${STANDARD_HOME}" ansible-playbook -h | sed "s|${STANDARD_HOME}|~|g" > src/commcare_cloud/help_cache/ansible-playbook.txt docs/commcare-cloud/commands/index.md : src/commcare_cloud/* src/commcare_cloud/*/* src/commcare_cloud/*/*/* manage-commcare-cloud make-docs > docs/commcare-cloud/commands/index.md