Skip to content

Commit 7094e0a

Browse files
committed
Use 'uname' instead of 'hdiutil' to determine OS.
1 parent c7179a4 commit 7094e0a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

build-iso

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ORIG="work/ubuntu-$VERSION-$DISTRO-$ARCH.iso"
88
COPY="work/ubuntu-$VERSION-$DISTRO-$ARCH"
99
ISO="work/$NICKNAME-ubuntu-$VERSION-$DISTRO-$ARCH.iso"
1010
MOUNT="work/mount"
11-
MACOS=$(which hdiutil)
11+
PLATFORM=$(uname)
1212

1313
# Download the original ISO if it isn't present already.
1414
[ -f "$ORIG" ] || curl -L -o "$ORIG" \
@@ -23,7 +23,7 @@ mkdir "$MOUNT"
2323

2424
echo Mounting ISO
2525
# Make a writable copy of the original ISO.
26-
if [ "$MACOS" ]; then
26+
if [ "$PLATFORM" = "Darwin" ]; then
2727
# os x
2828
DEVNODE=$(sudo hdiutil attach -nomount "$ORIG" | head -1 | awk "{print \$1}")
2929
sudo mount -t cd9660 "$DEVNODE" "$MOUNT"
@@ -37,7 +37,7 @@ rsync -a "$MOUNT/" "$COPY"
3737

3838
echo Unmounting ISO
3939
sudo umount "$MOUNT"
40-
if [ "$MACOS" ]; then
40+
if [ "$PLATFORM" = "Darwin" ]; then
4141
sudo hdiutil eject "$DEVNODE"
4242
fi
4343
rm -rf "$MOUNT"

0 commit comments

Comments
 (0)