77collection := $(notdir $(realpath $(CURDIR ) ) )
88namespace := $(notdir $(realpath $(CURDIR ) /.. ) )
99toplevel := $(notdir $(realpath $(CURDIR ) /../..) )
10-
1110err_msg := Place collection at <WHATEVER>/ansible_collections/paloaltonetworks/panos
12- ifneq (panos,$(collection ) )
13- $(error $(err_msg))
14- else ifneq (paloaltonetworks,$(namespace))
15- $(error $(err_msg))
16- else ifneq (ansible_collections,$(toplevel))
17- $(error $(err_msg))
11+
12+ # List of targets that require path check
13+ PATH_CHECK_TARGETS := old-sanity new-sanity
14+
15+ # Check if current target requires path check
16+ ifneq ($(filter $(MAKECMDGOALS ) ,$(PATH_CHECK_TARGETS ) ) ,)
17+ ifneq (panos,$(collection))
18+ $(error $(err_msg))
19+ else ifneq (paloaltonetworks,$(namespace))
20+ $(error $(err_msg))
21+ else ifneq (ansible_collections,$(toplevel))
22+ $(error $(err_msg))
23+ endif
1824endif
1925
2026python_version := $(shell \
@@ -32,7 +38,7 @@ docs: ## Build collection documentation
3238 rm -rf docs/html
3339 rm -rf docs/source/modules
3440 mkdir antsibull
35- poetry run antsibull-docs collection --use-current --dest-dir antsibull --no-indexes paloaltonetworks.panos
41+ antsibull-docs collection --use-current --dest-dir antsibull --no-indexes paloaltonetworks.panos
3642 mkdir -p docs/source/modules
3743 mv antsibull/collections/paloaltonetworks/panos/* docs/source/modules
3844 rm -rf antsibull
0 commit comments