Skip to content

Commit 8979ebc

Browse files
authored
Print errors when creating directories in makefile (#12338)
1 parent f9dd597 commit 8979ebc

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

toolkit/scripts/utils.mk

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,14 @@ no_repo_acl = $(STATUS_FLAGS_DIR)/no_repo_acl.flag
2020
# Creates a folder if it doesn't exist. Also sets the timestamp to 0 if it is
2121
# created.
2222
#
23+
# To allow output to be printed, we use the $(eval) function to create a new
24+
# variable _out which will contain the output of the shell command. If the output
25+
# is not empty, we print it to the console.
26+
#
2327
# $1 - Folder path
2428
define create_folder
25-
$(call shell_real_build_only, if [ ! -d $1 ]; then mkdir -p $1 && touch -d @0 $1 ; fi )
29+
$(eval _out := $(call shell_real_build_only, if [ ! -d $1 ]; then mkdir -p $1 2>&1 && touch -d @0 $1 ; fi ))
30+
$(if $(strip $(_out)),$(warning $(_out)))
2631
endef
2732

2833
# Runs a shell commannd only if we are actually doing a build rather than parsing the makefile for tab-completion etc

0 commit comments

Comments
 (0)