Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install script failing on unzip command on MacOS 15.4 #82

Open
marcelroed opened this issue Feb 27, 2025 · 0 comments · May be fixed by #83
Open

Install script failing on unzip command on MacOS 15.4 #82

marcelroed opened this issue Feb 27, 2025 · 0 comments · May be fixed by #83

Comments

@marcelroed
Copy link

Hi! The install script fails on my Mac running MacOS 15.4. It seems like when running unzip, the directory dist is not found:

$ ./install.sh   # Also happens with curl ... | sh
Downloading 'sf' CLI binary...
curl -L -o "/var/folders/bd/847y_93d4tl6nwdgxdzs7lgm0000gn/T/tmp.WEvuMSCEhV/sf.zip" "https://github.com/sfcompute/cli/releases/latest/download/sf-aarch64-apple-darwin.zip"
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 39.2M  100 39.2M    0     0  26.0M      0  0:00:01  0:00:01 --:--:-- 54.9M
unzip -o "/var/folders/bd/847y_93d4tl6nwdgxdzs7lgm0000gn/T/tmp.WEvuMSCEhV/sf.zip" -d "/var/folders/bd/847y_93d4tl6nwdgxdzs7lgm0000gn/T/tmp.WEvuMSCEhV/dist"
Invalid extraction directory
Failed to extract sf

This is simply fixed by making the dist dir in the created TMPDIR. So from this:

# Extract the zip file in the temporary directory.
echo "unzip -o \"${TMPDIR}/${BINARY_NAME}.zip\" -d \"${TMPDIR}/dist\""
unzip -o "${TMPDIR}/${BINARY_NAME}.zip" -d "${TMPDIR}/dist" || { echo "Failed to extract sf"; exit 1; }

to this

# Extract the zip file in the temporary directory.
mkdir "${TMPDIR}/dist"
echo "unzip -o \"${TMPDIR}/${BINARY_NAME}.zip\" -d \"${TMPDIR}/dist\""
unzip -o "${TMPDIR}/${BINARY_NAME}.zip" -d "${TMPDIR}/dist" || { echo "Failed to extract sf"; exit 1; }

I'm not sure why this wouldn't fail on other machines -- maybe it's because unzip on MacOS has modifications made by Apple?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant