From aee8e41e31f0c2642c3e526aec5e849516f90e5f Mon Sep 17 00:00:00 2001 From: Sihyung Woo <75494566+sihyung-maxim@users.noreply.github.com> Date: Tue, 1 Oct 2024 13:22:30 -0500 Subject: [PATCH] fix(Build): Don't update version when working in non-GitHub environments (#1199) --- Libraries/CMSIS/Device/Maxim/GCC/gcc.mk | 7 +++++-- Libraries/CMSIS/Device/Maxim/GCC/gcc_riscv.mk | 5 ++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Libraries/CMSIS/Device/Maxim/GCC/gcc.mk b/Libraries/CMSIS/Device/Maxim/GCC/gcc.mk index 95b1964837..1e44ca16d7 100644 --- a/Libraries/CMSIS/Device/Maxim/GCC/gcc.mk +++ b/Libraries/CMSIS/Device/Maxim/GCC/gcc.mk @@ -24,7 +24,7 @@ ifeq "$(PYTHON_CMD)" "" # Try python -ifneq "$(wildcard $(MAXIM_PATH)/.git)" "" +ifneq "$(wildcard $(MAXIM_PATH)/.github)" "" PYTHON_VERSION := $(shell python --version) ifneq ($(.SHELLSTATUS),0) PYTHON_CMD := none @@ -46,11 +46,14 @@ endif export PYTHON_CMD endif -# Run script +# Make sure script exists before running. This won't run when working in the official MSDK release (non-GitHub) +ifneq ("$(wildcard $(MAXIM_PATH)/.github)", "") +# Run script if exists. ifneq "$(PYTHON_CMD)" "none" UPDATE_VERSION_OUTPUT := $(shell python $(MAXIM_PATH)/.github/workflows/scripts/update_version.py) else $(warning No Python installation detected on your system! Will not automatically update version info.) +endif endif endif diff --git a/Libraries/CMSIS/Device/Maxim/GCC/gcc_riscv.mk b/Libraries/CMSIS/Device/Maxim/GCC/gcc_riscv.mk index c64ef43fe6..e8f3515986 100644 --- a/Libraries/CMSIS/Device/Maxim/GCC/gcc_riscv.mk +++ b/Libraries/CMSIS/Device/Maxim/GCC/gcc_riscv.mk @@ -47,11 +47,14 @@ endif export PYTHON_CMD endif -# Run script +# Make sure script exists before running. This won't run when working in the official MSDK release (non-GitHub) +ifneq ("$(wildcard $(MAXIM_PATH)/.github)", "") +# Run script if exists. ifneq "$(PYTHON_CMD)" "none" UPDATE_VERSION_OUTPUT := $(shell python $(MAXIM_PATH)/.github/workflows/scripts/update_version.py) else $(warning No Python installation detected on your system! Will not automatically update version info.) +endif endif endif