-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgeniospkg
executable file
·40 lines (34 loc) · 1.14 KB
/
geniospkg
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
#!/bin/bash
# Copyright 2024 The Lynx Authors. All rights reserved.
# Licensed under the Apache License Version 2.0 that can be found in the
# LICENSE file in the root directory of this source tree.
set -x
set -e
# This script is used to generate a iOS source code package with zip format
BASENAME="${0%/*}"
if [ -z "$PACKAGE_ENV" ]; then
PACKAGE_ENV="local"
fi
echo "========== iOS source code packaging in the $PACKAGE_ENV environment =========="
if [ "$PACKAGE_ENV" = "local" ]; then
if [ ! -d "package_example" ]; then
mkdir package_example
fi
if [ ! -f "package_example/package.zip" ]; then
git archive -o package_example/package.zip `git branch --show-current`
fi
cd package_example
if [ ! -d "package" ]; then
unzip package.zip -d package
cd package
# habitat requires a git repository
git init
git add .
git commit -m "init"
else
cd package
fi
elif [ "$PACKAGE_ENV" = "prod" ]; then
echo -e "\033[31mWarning: Please note that the non-packaged files will be deleted in the prod environment.\033[0m"
fi
python3 $BASENAME/gen_ios_pkg.py "$@"