forked from facebook/flipper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest-run.sh
executable file
·61 lines (47 loc) · 1.48 KB
/
test-run.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/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."