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"