This repository has been archived on 2025-10-02. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
inter-font/misc/mac-tmp-disk-mount.sh
2017-08-22 02:23:08 -07:00

25 lines
622 B
Bash
Executable file

#!/bin/bash
set -e
cd "$(dirname "$0")/.."
# Create if needed
if [[ ! -f build/tmp.sparseimage ]]; then
echo "Creating sparse disk image with case-sensitive file system build/tmp.sparseimage"
mkdir -p build
hdiutil create build/tmp.sparseimage \
-size 1g \
-type SPARSE \
-fs JHFS+X \
-volname tmp
fi
# Mount if needed
if ! (diskutil info build/tmp >/dev/null); then
echo "Mounting sparse disk image with case-sensitive file system at build/tmp"
hdiutil attach build/tmp.sparseimage \
-readwrite \
-mountpoint "$(pwd)/build/tmp" \
-nobrowse \
-noautoopen \
-noidmereveal
fi