@@ -15,29 +15,30 @@ elif [ -f /etc/alpine-release ]; then
1515fi
1616
1717# Pulumi installation script
18- # We'll use a temporary directory to avoid issues with $HOME in some container environments
19- export PULUMI_HOME=" /tmp/pulumi"
20- mkdir -p " ${PULUMI_HOME} "
21-
2218if [ " ${VERSION} " = " latest" ]; then
23- curl -fsSL https://get.pulumi.com | sh -s -- --install-root " ${PULUMI_HOME} "
19+ curl -fsSL https://get.pulumi.com | sh
2420else
25- curl -fsSL https://get.pulumi.com | sh -s -- --version " ${VERSION} " --install-root " ${PULUMI_HOME} "
21+ curl -fsSL https://get.pulumi.com | sh -s -- --version " ${VERSION} "
22+ fi
23+
24+ # Determine the binary path (script usually puts it in $HOME/.pulumi/bin or /root/.pulumi/bin)
25+ PULUMI_BIN_DIR=" $HOME /.pulumi/bin"
26+ if [ ! -d " $PULUMI_BIN_DIR " ]; then
27+ PULUMI_BIN_DIR=" /root/.pulumi/bin"
2628fi
2729
28- # Move binaries to /usr/local/bin so they are in the PATH for all users
29- # The installer might put them in bin/ or .pulumi/bin/ depending on the version/environment
30- if [ -d " ${PULUMI_HOME} / bin" ] ; then
31- mv " ${PULUMI_HOME} /bin/ " * /usr/local/bin/
32- elif [ -d " ${PULUMI_HOME} /.pulumi/ bin" ] ; then
33- mv " ${PULUMI_HOME} /.pulumi/bin/ " * /usr/local/bin/
30+ # Ensure the binaries are accessible on the system PATH for all users
31+ if [ -d " $PULUMI_BIN_DIR " ] ; then
32+ echo " Linking Pulumi binaries to /usr/local/ bin... "
33+ for bin in " $PULUMI_BIN_DIR " / * ; do
34+ ln -sf " $bin " " /usr/local/ bin/ $( basename " $bin " ) "
35+ done
3436fi
35- rm -rf " ${PULUMI_HOME} "
3637
3738# Clean up apt lists if on Debian
3839if [ -f /etc/debian_version ]; then
3940 rm -rf /var/lib/apt/lists/*
4041fi
4142
4243echo " Pulumi installed successfully!"
43- /usr/local/bin/ pulumi version
44+ pulumi version
0 commit comments