#!/bin/bash1# Copyright 2018 Google Inc.2#3# Licensed under the Apache License, Version 2.0 (the "License");4# you may not use this file except in compliance with the License.5# You may obtain a copy of the License at6#7# http://www.apache.org/licenses/LICENSE-2.08#9# Unless required by applicable law or agreed to in writing, software10# distributed under the License is distributed on an "AS IS" BASIS,11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.12# See the License for the specific language governing permissions and13# limitations under the License.14#15################################################################################16#1718DMGFILE=$119OUTFILE=$22021echo $OUTFILE2223mkdir -p tmp24VOLUME="$(hdiutil attach "${DMGFILE}" | tail -1 | awk -F'\t' '{print $NF}')"25CWD="`pwd`"26echo ${VOLUME}27cd "${VOLUME}"28zip -r /tmp/firefox.zip *.app29cd "${CWD}"30hdiutil detach "${VOLUME}" >/dev/null31#rm "${DMGFILE}"32mv /tmp/firefox.zip "$OUTFILE"333435