aws-sam-cli-local
aws-sam-cli-local copied to clipboard
The wrong path to samlocal is being used in makefile for-loops
I am running my make commands within a Git bash shell on Windows 10.
Actual Makefile target causing the problem:
TEMPLATES = $(shell find . -type f -name 'template.yml')
## Check
## Validate the SAM template
.PHONY: check
check: $(TEMPLATES)
for template in $^ ; do samlocal validate -t $${template} ; done
Altered Makefile target that easily reproduces the problem:
test: $(shell ls *.*)
for template in $^ ; do samlocal --version ; done
Running make test with samlocal in the for-loop yields:
C:\My\Path\To\python.exe: can't open file 'C:\\c\\_git\\localstack-poc\\.venv\\Scripts\\samlocal': [Errno 2] No such file or directory
make: *** [Makefile:43: test] Error 2
Running make test with sam in the for-loop yields:
SAM CLI, version 1.61.0
NOTE:
I do NOT have issues running samlocal outside the context of loops (i.e. stand-alone lines). Those commands run successfully.
Thanks for reporting @bamajap . We have just released a new version to pypi - can you please verify if the problem still persists with the latest version of samlocal? Thanks!
(Apologies for the (very) delayed response, but I had to wait until I could get a new license.)
This is still happening as of version SAM CLI 1.98.0. The C: at the beginning of the path to samlocal should be removed, but it appears that it is still prepended to the path.
Hi @bamajap, Just reaching out to check if you were able to resolve this issue or do you need our assistance?
Closing issue due to inactivity.