#!/bin/bash command -v 7z >/dev/null 2>&1 || ( echo "Error: '7z' binary is missing." >&2; exit 1 ) set -ex VERSION=3.18 PACKAGE="https://dl.winehq.org/wine-builds/macosx/pool/portable-winehq-staging-${VERSION}-osx.tar.gz" ENGINE_DIR="${HOME}/Library/Application Support/Wineskin/Engines" ENGINE_FILE="${ENGINE_DIR}/WS9Wine${VERSION}.tar.7z" if [ -e "${ENGINE_FILE}" ]; then echo "Error: File '$ENGINE_FILE' already exists. Aborting" >&2 exit 1 fi TMPDIR=$(mktemp -d) ( cd ${TMPDIR} curl -SL "${PACKAGE}" | tar -zxf - mv usr wswine.bundle echo "wine${VERSION}" > wswine.bundle/VERSION mkdir -p "${ENGINE_DIR}" tar cf - wswine.bundle | 7z a -si "${ENGINE_FILE}" )