©️ Use ditto to copy files

This commit is contained in:
Ben Chatelain 2018-10-17 16:48:35 -06:00
parent 7180928859
commit 715bde70b3
2 changed files with 8 additions and 13 deletions

View file

@ -31,7 +31,7 @@ class Mas < Formula
"OBJROOT=#{buildpath.realpath}",
"SYMROOT=#{buildpath.realpath}"
system "script/install"
system "script/install", prefix
bash_completion.install "contrib/completion/mas-completion.bash" => "mas"
end

View file

@ -3,6 +3,7 @@
PREFIX=/usr/local
INSTALL_TEMPORARY_FOLDER=/tmp/mas-cli.dst
# Override default prefix path with optional 1st arg
if test -n "$1"; then
PREFIX="$1"
fi
@ -11,16 +12,10 @@ echo "==> 📲 Installing mas to $PREFIX"
xcodebuild install
pushd "$INSTALL_TEMPORARY_FOLDER"
ditto -v \
"$INSTALL_TEMPORARY_FOLDER/Frameworks" \
"$PREFIX/Frameworks"
mkdir -p "$PREFIX/Frameworks/"
mv -v \
Frameworks/MasKit.framework \
"$PREFIX/Frameworks/"
mv -f \
bin/mas \
"$PREFIX/bin/"
popd
ditto -v \
"$INSTALL_TEMPORARY_FOLDER/bin" \
"$PREFIX/bin"