From 715bde70b35ca2eb1ec46c89bdca3bae89e61fa0 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Wed, 17 Oct 2018 16:48:35 -0600 Subject: [PATCH] =?UTF-8?q?=C2=A9=EF=B8=8F=20Use=20ditto=20to=20copy=20fil?= =?UTF-8?q?es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Homebrew/mas.rb | 2 +- script/install | 19 +++++++------------ 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/Homebrew/mas.rb b/Homebrew/mas.rb index 0b2c0a0..976f9fe 100644 --- a/Homebrew/mas.rb +++ b/Homebrew/mas.rb @@ -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 diff --git a/script/install b/script/install index 3adb2c0..aea2abc 100755 --- a/script/install +++ b/script/install @@ -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"