Files
flipper/packer/test-run.sh
Andres Suarez 79023ee190 Update copyright headers from Facebook to Meta
Reviewed By: bhamodi

Differential Revision: D33331422

fbshipit-source-id: 016e8dcc0c0c7f1fc353a348b54fda0d5e2ddc01
2021-12-27 14:31:45 -08:00

62 lines
1.5 KiB
Bash
Executable File

#!/bin/bash
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
echo "Starting a manual test run ..."
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
DIST_DIR="$DIR/../dist"
if [[ ! -d $DIST_DIR/mac || ! -d $DIST_DIR/linux-unpacked || ! -d $DIST_DIR/win-unpacked ]]; then
echo "ERR: Needs distributions built for Mac, Linux and Windows."
echo "Please run in this in the desktop directory:"
echo "$ yarn build --mac --linux --win"
exit 1
fi
has_resources() {
if ! tar tf "$1" | grep '[Rr]esources/app.asar' > /dev/null; then
echo "ERR: $1 for $2 does not contain a resource bundle. Check your packfile!"
exit 2
fi
}
has_no_resources() {
if (( $(tar tf "$1" | grep -cFv '[Rr]esources/app.asar') < 10 )); then
echo "ERR: $1 for $2 has suspiciously low number of non-resource files. Check your packfile!"
exit 2
fi
}
echo "Build for Mac ..."
cargo run mac
has_resources core.tar.xz mac
has_no_resources frameworks.tar.xz mac
cat manifest.json
echo
echo "All good."
echo "Build for Linux ..."
cargo run linux
has_resources core.tar.xz linux
has_no_resources frameworks.tar.xz linux
cat manifest.json
echo
echo "All good."
echo "Building for Windows ..."
cargo run windows
has_resources core.tar.xz windows
has_no_resources frameworks.tar.xz windows
cat manifest.json
echo
echo "All good. Ship it."