From cb46eeafbef7ed527f6407d6f4d482508928c5cf Mon Sep 17 00:00:00 2001 From: Kshitij Sobti Date: Fri, 28 Apr 2023 09:10:21 +0530 Subject: [PATCH] fix: Switch from echo to prinf for more consistent behaviour In different environments echo seems to handle escape characters differently. When generating the common constraints file, on some systems it outputs the "\n" character as-is. This change switches echo to printf, which is supposed to be more consistent. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 1f835fd976..8a0a6840f4 100644 --- a/Makefile +++ b/Makefile @@ -117,7 +117,7 @@ COMMON_CONSTRAINTS_TXT=requirements/common_constraints.txt .PHONY: $(COMMON_CONSTRAINTS_TXT) $(COMMON_CONSTRAINTS_TXT): wget -O "$(@)" https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt || touch "$(@)" - echo "$(COMMON_CONSTRAINTS_TEMP_COMMENT)" | cat - $(@) > temp && mv temp $(@) + printf "$(COMMON_CONSTRAINTS_TEMP_COMMENT)" | cat - $(@) > temp && mv temp $(@) compile-requirements: export CUSTOM_COMPILE_COMMAND=make upgrade compile-requirements: pre-requirements $(COMMON_CONSTRAINTS_TXT) ## Re-compile *.in requirements to *.txt