System: Win10 with MinGW make
I am trying to store PowerShell output in a variable inside of the recipe, and unfortunately I've exhausted all options.
Variable that stores powershell command:
# Get newest package in the directory
LST_PKG := powershell "gci -Path . -File *.nipkg -Recurse -Name | sort creationtime | Select -First 1"
The output is builds\packages\srl-lut_1.2.0.32_windows_all.nipkg
The actual recipe that's not working (PKG_REL_PATH end up empty):
.PHONY: publish
publish: clean build package
ifeq ($(DEBUG), 1)
@echo "Publishing a DEBUG package..."
#1. Copy package to feed repo
$(eval PKG_REL_PATH = $(LST_PKG))
cp $(ROOT_DIR)$(PKG_REL_PATH) $(TEST_FEED_REPO)
#2. Publish the package
else
@echo "Publishing a RELEASE package..."
endif
Partial output indicative of the issue:
"Publishing a DEBUG package..."
cp C:\Users\Public\Projects\SRL\lut\src\powershell "gci -Path . -File *.nipkg -Recurse -Name | sort creationtime | Select -First 1" \\raven\#Raven\SRLFeeds\SRL\Repo
'cp' is not recognized as an internal or external command,
operable program or batch file.
make: *** [makefile:78: publish] Error 1
It looks like LST_PKG does not expans and evaluate and just assigned as string to PKG_REL_PATH: cp C:\Users\Public\Projects\SRL\lut\src*powershell "gci -Path . -File .nipkg -Recurse -Name | sort creationtime | Select -First 1" \raven\#Raven\SRLFeeds\SRL\Repo