Previously, we assumed that the dynamic provider was located in `./node_modules/@pulumi/pulumi/../` which is correct in the majority of cases. However, tools like lerna or yarn workspaces (or custom workflows) allow the node_modules folder to be located elsewhere on disk, and node will still find it because of its algorithm for module resolution. So, do what we do in the language host itself, first launch node and ask it to tell us where it resolves a require statement to on disk and then launch node against that script. Fixes #2261
6 lines
275 B
Batchfile
6 lines
275 B
Batchfile
@echo off
|
|
setlocal
|
|
for /f "delims=" %%i in ('node -e "console.log(require.resolve('@pulumi/pulumi/cmd/dynamic-provider'))"') do set PULUMI_DYNAMIC_PROVIDER_SCRIPT_PATH=%%i
|
|
if DEFINED PULUMI_DYNAMIC_PROVIDER_SCRIPT_PATH (
|
|
@node "%PULUMI_DYNAMIC_PROVIDER_SCRIPT_PATH%" %*
|
|
)
|