Skip to content

Install script failing on unzip command on MacOS 15.4 #82

@marcelroed

Description

@marcelroed

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions