playwright/browser_patches/firefox/archive.sh

49 lines
1.2 KiB
Bash
Raw Normal View History

2019-11-19 05:18:28 +03:00
#!/bin/bash
if [[ ("$1" == "-h") || ("$1" == "--help") ]]; then
2019-11-20 21:31:26 +03:00
echo "usage: $(basename $0)"
2019-11-19 05:18:28 +03:00
echo
echo "Generate distributable .zip archive from ./checkout folder that was previously built."
echo
exit 0
fi
set -e
set -x
createZIPForLinuxOrMac() {
local zipname=$1
local OBJ_FOLDER=$(ls -1 | grep obj-)
if [[ $OBJ_FOLDER == "" ]]; then
echo "ERROR: cannot find obj-* folder in the checkout/. Did you build?"
exit 1;
fi
if ! [[ -d $OBJ_FOLDER/dist/firefox ]]; then
echo "ERROR: cannot find $OBJ_FOLDER/dist/firefox folder in the checkout/. Did you build?"
exit 1;
fi
# Copy the libstdc++ version we linked against.
# TODO(aslushnikov): this won't be needed with official builds.
if [[ "$(uname)" == "Linux" ]]; then
cp /usr/lib/x86_64-linux-gnu/libstdc++.so.6 $OBJ_FOLDER/dist/firefox/libstdc++.so.6
fi
# tar resulting directory and cleanup TMP.
cd $OBJ_FOLDER/dist
zip -r ../../../$zipname firefox
cd -
}
2019-11-20 03:08:27 +03:00
trap "cd $(pwd -P)" EXIT
2019-11-20 21:08:55 +03:00
cd "$(dirname $0)"
2019-11-20 03:08:27 +03:00
cd checkout
2019-11-19 05:18:28 +03:00
if [[ "$(uname)" == "Darwin" ]]; then
createZIPForLinuxOrMac "firefox-mac.zip"
elif [[ "$(uname)" == "Linux" ]]; then
createZIPForLinuxOrMac "firefox-linux.zip"
else
echo "ERROR: cannot upload on this platform!" 1>&2
exit 1;
fi