Skip to content

Commit

Permalink
Check for /usr/local/bin before installing the command line tool
Browse files Browse the repository at this point in the history
  • Loading branch information
trasch committed May 21, 2024
1 parent e9f3309 commit d195d9d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion install_mvt.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
#!/bin/sh

swift build -c release --arch arm64 --arch x86_64 --product mvt >/dev/null
echo "Building the 'mvt' command line tool..."

swift build --quiet -c release --arch arm64 --arch x86_64 --product mvt 2>&1 >/dev/null
if [[ $? -ne 0 ]]
then
echo "Failed to build 'mvt'"
exit 1
fi

if [[ ! -d "/usr/local/bin" ]]
then
echo "/usr/local/bin doesn't exist, trying to create it (with sudo)"
sudo mkdir -p /usr/local/bin || exit 1
fi

cp .build/apple/Products/Release/mvt /usr/local/bin/
if [[ $? -ne 0 ]]
then
Expand Down

0 comments on commit d195d9d

Please sign in to comment.