I am currently working on a project where we are making use of a Salesforce related feature built a while ago (static resource builder). The feature is preparing a static resource zip by:
@echo off
call npm install -g handlebars@4.2.0
setlocal EnableDelayedExpansion
set "Filesx=My_Theme1 My_Theme2 My_Theme3"
for %%i in (%Filesx%) do (
echo %%iset "result="for %%b in (C:\MyProject\src\staticresources%%i\js\templates) do (
echo %%b
set "t="
for /f "delims=" %%q in ('dir /s /b /a:-d %%b') do (
set "t=!t! %%q"
)
call handlebars !t! -f C:\MyProject\src\staticresources\%%i\js\templates.js -n Some.templates
)
)
@echo on
**Notes: **
The process was working fine till few weeks ago when the C:\MyProject\src\staticresources\My_Theme3\js\templates folder has been updated with few new .handlebars files. Since then, it looks like the call handlebars !t! -f C:\MyProject\src\staticresources%%i\js\templates.js -n Some.templates command is failing, looking like it hit some limit and the templates.js file cannot be created.
This is purely my guess, but I have no experience with java script or handlebars.
The error that comes up during the compress process: C:\MyProject\src\staticresources\My_Theme3\js\templates.js does not exist.
My question would be, is there any limit we should be aware of, when it comes to js files ? Alternatively, would you have any suggestion on what to be modified in the script to make it work ?
Happy to share more details if required.
Thanks in advance.
My_Theme1 and My_Theme2 are being processed correctly. I tried to remove them from the Filesx from the .bat script, keeping only the affected one (My_Theme3) but the result was similar.