mirror of
https://github.com/microsoft/playwright.git
synced 2024-12-14 05:37:20 +03:00
8a81b11d33
This patch will produce a stub build of WebKit for MacOS 10.14 with a stub that errors out with a descriptive error. References #6879
49 lines
1.0 KiB
Bash
Executable File
49 lines
1.0 KiB
Bash
Executable File
#!/bin/bash
|
|
set -e
|
|
set +x
|
|
|
|
if [[ ("$1" == "-h") || ("$1" == "--help") ]]; then
|
|
echo "usage: $(basename $0) [output-absolute-path]"
|
|
echo
|
|
echo "Generate distributable .zip archive from ./checkout folder that was previously built."
|
|
echo
|
|
exit 0
|
|
fi
|
|
|
|
ZIP_PATH=$1
|
|
if [[ $ZIP_PATH != /* ]]; then
|
|
echo "ERROR: path $ZIP_PATH is not absolute"
|
|
exit 1
|
|
fi
|
|
if [[ $ZIP_PATH != *.zip ]]; then
|
|
echo "ERROR: path $ZIP_PATH must have .zip extension"
|
|
exit 1
|
|
fi
|
|
if [[ -f $ZIP_PATH ]]; then
|
|
echo "ERROR: path $ZIP_PATH exists; can't do anything."
|
|
exit 1
|
|
fi
|
|
if ! [[ -d $(dirname $ZIP_PATH) ]]; then
|
|
echo "ERROR: folder for path $($ZIP_PATH) does not exist."
|
|
exit 1
|
|
fi
|
|
|
|
createZipForMac() {
|
|
# create a TMP directory to copy all necessary files
|
|
local tmpdir=$(mktemp -d)
|
|
|
|
# copy all relevant files
|
|
ditto {$SCRIPTS_DIR,$tmpdir}/pw_run.sh
|
|
# copy protocol
|
|
|
|
# zip resulting directory and cleanup TMP.
|
|
ditto -c -k $tmpdir $ZIP_PATH
|
|
rm -rf $tmpdir
|
|
}
|
|
|
|
trap "cd $(pwd -P)" EXIT
|
|
cd "$(dirname "$0")"
|
|
SCRIPTS_DIR="$(pwd -P)"
|
|
|
|
createZipForMac
|