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
5 lines
238 B
Bash
Executable file
5 lines
238 B
Bash
Executable file
#!/bin/sh
|
|
PULUMI_DYNAMIC_PROVIDER_SCRIPT_PATH=$(node -e "console.log(require.resolve('@pulumi/pulumi/cmd/dynamic-provider'))")
|
|
if [ ! -z "$PULUMI_DYNAMIC_PROVIDER_SCRIPT_PATH" ]; then
|
|
node "$PULUMI_DYNAMIC_PROVIDER_SCRIPT_PATH" $@
|
|
fi
|