From 669151b2b5848a4452b5c81f2f7183700b5aec3f Mon Sep 17 00:00:00 2001 From: Sander Cox Date: Thu, 19 Dec 2024 15:35:00 +0100 Subject: [PATCH] umask needs to be before any cargo command Moving umask fixes an issue where cargo install would otherwise create files in `/usr/local/cargo` that are owned by root. My dev container default has a user of vscode and that user now has no access to the files and cargo cannot install any packages used in my devcontainer. --- src/cargo-binstall/install.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cargo-binstall/install.sh b/src/cargo-binstall/install.sh index 57471f3..0415641 100644 --- a/src/cargo-binstall/install.sh +++ b/src/cargo-binstall/install.sh @@ -1,6 +1,8 @@ #!/bin/bash set -e +umask 002 + PACKAGES=${PACKAGES:-""} CARGO_PACKAGES=("${PACKAGES//,/ }") @@ -20,5 +22,4 @@ if [ -z "${PACKAGES}" ]; then exit 0 fi -umask 002 cargo binstall -y --force --locked $CARGO_PACKAGES